07-03-2014 04:53 PM
Hi folks,
I want to send "numerical values" (0 - 255) through the VISA Write (Serial) the problem is that this VI only lend me to send "strings"... and I need to send numbers. Check below please!
Thank You!
07-03-2014 05:17 PM
A byte is a byte. Whether the program interprets it as a string or as a numeric depends on the programmer.
Here is one way to do it. The Build Array creates a one-element array which is then converted to a one-character string by Byte Array to String.
You do not need the sequence structure. Dataflow will force the C to be written before the numeric array. Sequence structures should be avoided as they break dataflow and are rarely needed.
Generally you should not wire N and use autoindexing simultaneously. However it you only want the first 8 elements of a longer Columnas array, then what you show is acceptable.
It may not be a good idea to have the VISA Write inside the event structure. The event structure locks the fornt panel by default until the code inside completes execution. If for some reason the serial port was not working the program would be locked up until the 10 second timeout elapsed.
The VISA Session and error wires should be wired though every case of the event structure. Use Default if Unwired on those tunnels may result in the VISA sesson not being closed or an error not being reported.
Lynn
07-03-2014 05:21 PM
I wouldn't even use the FOR loop. Just use the Byte Array To String and the resulting string to the VISA Write.