LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help, please! Unbundle data from serial string (com-port)

Hello Mihalis,

last work before weekend 🙂

I included my two subVi into your "serial_to_string" as "2_channels.vi" was password-protected...
Have a nice weekend!


Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 11 of 30
(1,579 Views)

Hello GerdW !

Thank you for the help!!!  Sorry to trouble you.


Have a nice weekend too!

Best regards, Mihalis.

0 Kudos
Message 12 of 30
(1,570 Views)
Hello!
 
I need you help again! GerW, if you on-line, or anybody, help.
 
VI from previous message work correct (Unbundle data from serial string ), but one problem: if frame, which come from serial string starts from 11hex or 22hex (number of channel on my ATmega device), that all right, but if frame starts from other character (data, or end of frame symbol 0Dh), VI work wrong, because VI no account, from which character start scan from incoming string. (Need start scan from 11hex or 22hex).
How unbundle incoming string on 2 substring, each of which consist 4 bytes and first substring starts from 11hex and ends 0Dhex, and second substring srarts from 22hex and ends 0Dhex ?
 
I try use "scan from string" function, but I can`t do something Smiley Sad
 
Thank you!
0 Kudos
Message 13 of 30
(1,553 Views)
Hello Mihalis,

have a look at "string_2_data.vi". There I show you a way finding the "start of frame".

See you tomorrow...


Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 14 of 30
(1,545 Views)
Hello GerdW! Thanks for answer! (tomorrow is come? Smiley Happy)

VI work, but problem is stay. If VI start scan VISA string from 11h, or 22h, that all right, but if VI start scan stringfrom  another simbol, VI is hover.

 


 

0 Kudos
Message 15 of 30
(1,540 Views)
Hello Mihalis,

have a look at the subVi "string_to_data". It scans the string even with garbage in front of the data... And it works according to the test string (=default value).

What format has your data string? Can it include garbage between your data frames or just in front of the frames?


Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 16 of 30
(1,538 Views)
Hi GerdW!
 String don`t include garbage.
It consist 4 byte on first channel and 4 byte on second channel (11hex-lowbyte1-hibyte1-Dhex-22hex-lowbyte2-hibyte2-Dhex) in circle (1 and 2 channel fron ADC).
0 Kudos
Message 17 of 30
(1,536 Views)
Hello Mihalis,


why do you want to start scanning your string NOT at the start of the frame? Why should your VI "hover" when the data always starts with 11h?
Have you seen my subVis?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 18 of 30
(1,533 Views)
Hello GerdW!
"why do you want to start scanning your string NOT at the start of the frame"
Because, when i start VI, it may start scan string from my device not at the start of the frame, but in the middle of frame, or at the end, and graph is plot wrong.
I seen you subVis, and I studing, how VI work.
 
One question (not on subject): I clearly writing on ENGLISH? Thanks!
 
0 Kudos
Message 19 of 30
(1,531 Views)
Hello Mihalis,

so I suspect, your ADC is sending data all the time and you just listen to its broadcasting...
Try to see this data stream not as consecutive clusters but just as a byte stream. Then it is perhaps easier to extract the data you need (changing concept from "typecasting to cluster and unbundle" to "extract bytes from stream and append to correct array (ADC1/ADC2)").

On your question:
I'm not a native English speaker and I think you're also not. But we can express our thoughts and that's it.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 20 of 30
(1,528 Views)