LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous serial communication.

I am continuously receiving an ascii string from the Visa read i want to convert it to a hexadecimal. In this i want to start store from some hex like 5A if i found 5A in the string i need to store 5A along with the next 10 string characters to an array if i again found that 5A i need to start store along with the next upcoming 10 string characters. I anyone have some solution on this kindly help me to solve this

 

0 Kudos
Message 1 of 17
(1,699 Views)

Hi Rajsakthi,

 


@Rajsakthi wrote:

In this i want to start store from some hex like 5A if i found 5A in the string i need to store 5A along with the next 10 string characters to an array


What have you tried and where are you stuck?

What's the problem to search for a char inside a string and to take a StringSubset?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 17
(1,679 Views)

 can you please guide me to achieve continuous ascii string to convert to hex string.

 

0 Kudos
Message 3 of 17
(1,663 Views)

Rajsakthi_3-1707383667213.pngRajsakthi_4-1707383689749.png

 

Rajsakthi_5-1707383811016.png

 

I need the substring as 5A A5 2B 00 D1 FF 2F 95 30 6C

0 Kudos
Message 4 of 17
(1,649 Views)

Hi Raj,

 

mind to share your VI with same real data in the frontpanel elements set as default value?

We cannot debug/edit/run images in LabVIEW!

 

(Please downconvert (File->Save for previous)  to an older LabVIEW version when you use a recent one. I prefer LV2019.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 17
(1,647 Views)

i am using labview version 2015 will it supports to you.

0 Kudos
Message 6 of 17
(1,643 Views)

I am in working place so it is not possible to share the file.

0 Kudos
Message 7 of 17
(1,634 Views)

Hi Raj,

 


@Rajsakthi wrote:

I am in working place so it is not possible to share the file.


So you need to debug on your own...

 

Why do you even convert to hex-formatted string instead uf using the byte array delivered by VISARead? No need for this conversion (at this time)!

Use StringToU8Array and Search1DArray to search for 0x5A (=0d90), then use ArraySubset to get your data...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 17
(1,623 Views)

Assuming you already have your data as a numeric array. Just search for the value you want with Search 1D Array. For the next value, start from next index after your array. 

 

Strings.png

 

 

0 Kudos
Message 9 of 17
(1,607 Views)

Can you please share this as a VI file.

0 Kudos
Message 10 of 17
(1,603 Views)