Jump to content

Binary Register Controls


orko

Recommended Posts

Hello all,

I've been tasked to write up some VIs that are communicating to an old microcontroller in a unit through GPIO (this really doesn't matter, but I thought I'd give you an idea of how old the stuff is I'm dealing with :rolleyes: ). The old program is written in Turbo Pascal ( :blink: )

Anyway, it will be a pleasure to port these over to LabView. I'm wondering, since my old UI used binary 1's and 0's to allow the user to communicate/program registers, is there a set of old school controls somewhere that have been built that make it convenient?

Like:

Addr: 0|0|1|0|0|1|0|0

Value: 1|0|1|0|1|0|1|0

And an "enter" button to press when you have the right values in them. A plus would be if the control "auto-tabbed" through the bits while you were typing. In other words, clicking on the first bit in Addr and typing "00100100" would fill in the booleans appropriately without having to tab or click again on each bit.

Any thoughts/pointers? I'll start mixing up my own if no one can find their keys to the "OMG that's old" locker.

Joe (orko)

Link to comment
If I understand correctly, how about an array or cluster of LED controls? 1 = ON = Illuminated, 0 = OFF = dark?

That's what I'm after, essentially. I was hoping someone with more artistic talent than me had made one that had good picture overlays of the zeros and ones. Or perhaps had already solved the whole "auto-tabbing through an array" while someone is typing one bit at a time?

Or are you looking for text entry? Could use a string control and then parse it into bits.

Nope. No text. Just binary. I know I could use a numeric control, but would prefer a more "graphical" one, like the boolean array discussed above.

Thanks for your input! I'm thinking more now that I'll have to work these up myself, but if anyone has seen an example like this using boolean or picture ring controls, please let me know. :unsure:

Joe (orko)

Link to comment

Without having actually used the feature yet (he said authoritatively :P ), this sounds like an excellent place to try developing an XControl. Something along the lines of a cluster of booleans which capture keystrokes, test for 1's and 0's, and increment an active location while toggling little retro-PDP-8 paddle switches. Any chance you have LV8 but haven't broken the shrinkwrap/updated your LAVA profile?

Not an especially useful reply - but perhaps one to get others thinking...

Dave

Link to comment
[...] this sounds like an excellent place to try developing an XControl. Something along the lines of a cluster of booleans which capture keystrokes, test for 1's and 0's, and increment an active location while toggling little retro-PDP-8 paddle switches. Any chance you have LV8 but haven't broken the shrinkwrap/updated your LAVA profile?

I should be * :clock: :angry: :clock: * getting LV 8.0 from the "ones with plastic cards" in my division soon. Of course, that may be months, but I'm trying to push it for March.

XControls caught my eye when I first saw mention of them. It sure would be nice to assign functionality to controls that you use more than once. Perhaps I'll wait to put the finishing touches on this particular app until they give me my 8.0? :P

Thanks for the input!

Any reason why you don't want to use a regular numeric control in binary display mode?

Aesthetics. Pure aesthetics :D

Joe (orko)

Link to comment
Still remember feeling somehow cheated the first time I used a computer which didn't have a couple of banks of toggle switches and lights-- Somehow didn't seem quite like a computer when the only switches on the box itself were power and reset.
Of course, to be really faithful to the retro look, you would need to have paddle switches with labels like 'Examine' and 'Deposit/Next'.

Dave

Working where I do, I'm more used to seeing something like this...

post-3266-1140813806.jpg?width=400

Yep... those are lights, pushbuttons and banks of switches... for the UI...in octal. :blink:

Joe (orko)

Link to comment
Is that what you want?

This is very, *very* close...

I love how you handled tabbing through the array! Updating the array from another control instead of trying to work backwards and move the focus each time a value was enterred *into* the array was something I hadn't even considered. I think that with a little tweaking I can make the boolean controls in the array look more like the labels that appear below them (instead of the green LED look) and then hide the existing labels so it looks like you're enterring the zeros/ones into a register. Then I could play with the pics to get them to look the way my gui was designed to look. Old ;)

This could be very workable... :thumbup:

Thanks you very much!

Joe (orko)

Link to comment

Here's another variation: I have used a Cluster of numeric controls (restricted to 0 and 1 values only) and the KeyFocus property to get the "autotabbing." Run the VI and start typing the 0s and 1s. The last entry (7th bit) will output the final array of values entered.

:!: NOTE: Run this VI by clicking on the Run arrow on the toolbar, and NOT by hitting Ctrl+r. Ctrl+r seems to trigger the KeyUp events! This behaviour can be fixed by filtering "Menu" keys (i.e., Ctrl) using the 'Mods' output in the Event structure. This is left as an exercise for the students :P

Regards,

-Khalid

Download File:post-311-1140852807.vi

Link to comment
Here's another variation:

Khalid,

Thanks for the different way of doing this. I'll take a look at it when I get back to the office on Monday, but it always helps to have several ways of handling a problem before deciding the best way :)

Cheers!

Joe (orko)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.