07-02-2009 04:26 PM
07-02-2009 04:38 PM
I can understand why you are confused.
Whoever wrote that didn't know what they were doing. The local variables and stacked sequence structurs are painful to look at! Several items in there such as comparing a boolean control to a boolean constant are straight out of the Rube Goldberg thread. I like how the one stacked sequence structure (in frame1 of the big stacked sequence) uses 6 frames to send 1 byte at a time to the serial port.
07-02-2009 04:53 PM
I agree. That is a very bad example. How did you actually find it? Don't even bother with it - just delete it.
Try the attached VI and see how far you get.
07-08-2009 05:39 AM
wowwww !!!!
thanks smercurio_fc !
i have just trie it and it realy works beautifuly !
i´m going to analise how it works !
you are right it seems mutch more simple !!!
thanks again.
07-09-2009 11:32 AM
hello !
the programme is runing very well !
a can separate in a string , 8byts, whith 8bits ! (some experiences) y x
From the pic i´m sending 4 byts , 2 for eatch ADC! a read something like (03 ;255) = 5V!
I have tried meny solutions but don´t seame very estable!tried numeric operations ......x+(256*Y)
how can i ad this two numbers to be with 1024 ?? am i going on a wrong way????
07-09-2009 12:04 PM
07-09-2009 02:28 PM
Sorry !
well what i was triing to say ,was that a´m sending data from ADC .The ADC has a 10bit resolution!in serial comunication ,i can only send 8bits string.
if i want to read 10bit from ADC , i must send 2 byts ( 2x8bits) right ???
when ADC is reading ex: 5V he must have 1024 positions(10bits)!In Labview , i can read 2 byts the first(03), and the second (255).
I have tried to add this 2 byts in order to have 1024 ( 10 bits). Ex:
first byte (x) second byte(Y)
(03) (256) X+(256xY)=result(1024)
this aplication works,but it doesn´t seme very stable!!!!
my question is :how do i add this 2 byts, or there is a more simple way!
am i taking a wrong direction???
I´m realy sory about my ingles!!
07-09-2009 02:46 PM - edited 07-09-2009 02:49 PM
Yes. You can use the join bytes function. You wire in two U8 bytes and out comes a single U16 byte.
07-09-2009 03:29 PM
A Type Cast would give you the same thing.
07-09-2009 06:33 PM
smercurio_fc wrote:A Type Cast would give you the same thing.
Dohhh! Of course.
What got me on the path of the join bytes was that other thread where the poster was trying to decipher the byte but said that the byte of interest was slipping between the first and second byte.