LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial only reads 2 characters....

Solved!
Go to solution
Convert the string to a byte array and use a FOR loop to send each byte out.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 21 of 35
(2,090 Views)

Thanks,

 

             i'm just playing with that now, but i've run into problems, as some of my data is text and some is numbers how can i index the data in the byte array ?

0 Kudos
Message 22 of 35
(2,088 Views)
Simply wire the byte array to the FOR loop and using autoindexing. If you are still having problems post your code.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 23 of 35
(2,085 Views)

Just tried to wire the byte array to N but it is expecting 32bit.

 

 

heres my code before i tried to wire to N:Untitled.jpg

0 Kudos
Message 24 of 35
(2,082 Views)
Sorry, ignore that, its the wrong picture (serves my right for calling everything untitled i suppose)
0 Kudos
Message 25 of 35
(2,080 Views)
notUntitled.jpg
0 Kudos
Message 26 of 35
(2,080 Views)
Solution
Accepted by topic author Zac_Acal

Here is an example of what you should try. (I didn't complete all of the wiring such as the VISA resource)

 

Send Single Bytes.png

 

You should really consider cleaning up your code. Having wires running back in your code (right to left) is a very bad habit and makes the code difficult to read. There were several suggestions given earlier regarding things you can do to cleanup the code. It will help you in the long run to develop good style and good programming habits.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 27 of 35
(2,076 Views)
How did you change the N in the loop to a small N with a red dot ? and what is the significance of that ?
0 Kudos
Message 28 of 35
(2,072 Views)
I added the conditional terminal which allows the FOR loop to abort early (I have the error wired to the condtition). I believe this was added in LabVIEW 8.6.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 29 of 35
(2,070 Views)

I change my value to 101, the array shows :   0 =108,  1 = 50, 2 = 49 3 = 48  what am i doing wrong  ???  

 

 

 

labviewimg.jpg

0 Kudos
Message 30 of 35
(2,067 Views)