LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert a normal number to binary?

Move the diagram window so it does not overlap with the front panel window. Now click on "execution highlighting", the button with the light bulb.
Run the VI and click on things while watching the diagram. You should see how things operate.
 
  • If a timeout occurs, it sends the 63.
  • If action changes, it check which button has been pressed and gets the corresponding value from the array diagram constant. if no button has been pressed, we get -1, which translates to element zero after the increment and we get a x0A. The speed is always sent. (I am not sure if this is correct).
 
Is there anything specific that confuses you?
 
Here is the same with a small mistkae corrected. For some reason, the "63" was I32 istead of U8. There are probably still some other buglets. 😉
0 Kudos
Message 41 of 129
(1,621 Views)
Here is where I am. right now .
 
I have realized that the speed should not be part of the character string all the time, so i removed it.
 
For some reason the bytes werent adding up to 6, so i hard wired 6 bytes as the byte count.
 
ALTENBACH: I need to know about your multiple pushbutton thing. The buttons dont seem to corrspond to the hex values they should be, im trying to fix that.
 
 
Does this VI have all the required blocks to "fire up" the actual serial communication? The display seems to be the sequence of numbers i want, but it just dosent work. It makes me think maybe it dosent get transmitted.
 
 
 
 
 
 
 
0 Kudos
Message 42 of 129
(1,604 Views)
I don't do any serial, because I don't have your hardware. You need to place the visa stuff back in.
 
The buttons is just an array of button. If you press one of them, the event fires and "search array" tries to find which one fired. Then all buttons are set to OFF again via a local variable. Since we add 1 to the found index, we get:
  • all buttons off, search returns -1, get element 0 (first element) of the array diagram constant (x0A)
  • first button pressed, search returns 0, get element 1 (second element) of the array diagram constant (x00)
  • ...
  • last button pressed, get element 6 (x08).

If you want another response, change the array constants! 🙂

Are you sure that the size should not be included for the checksum calculation?

0 Kudos
Message 43 of 129
(1,597 Views)

Ok I fixed the push button snafu.

 

 

0 Kudos
Message 44 of 129
(1,597 Views)
This is a great example of the community nature of the LV community. 
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 45 of 129
(1,593 Views)

that was a fascinating thread.

but did somebody mentioned LV9???

 

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 46 of 129
(1,583 Views)


@Gabi1 wrote:
but did somebody mentioned LV9???
That VI was actually 8.2, rounded up to 9.0, I guess. After all, we're dealing mostly with integers in this thread. 😄
0 Kudos
Message 47 of 129
(1,578 Views)

Lets not stray too far off topic here.

 

THE VI DOES NOT WORK!

 

(  ACK!, and yet no ACK )

0 Kudos
Message 48 of 129
(1,577 Views)


@Vr6Fidelity wrote:
Ok I fixed the push button snafu.
What exactly did you fix?
0 Kudos
Message 49 of 129
(1,575 Views)

I eliminated a button, and re-coded what the hex codes were so they did what they said.

 

what about some of my other questions? Like does the vi actually output tru the serial com1 port?

0 Kudos
Message 50 of 129
(1,572 Views)