LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String to data

Hello,
I have to send a string to a server, so it can be analysed. The VI running on the server cannot be changed, and the image ausgang.JPG a part of it. The response on the STRING TO DATA (?) has to be 3, in order to start the analysing-loop. But I get always a 0.
What do I have to do with my string to make the loop work? (so, how to get 3 as output of the STRING TO DATA)
0 Kudos
Message 1 of 10
(2,822 Views)
If you read the err output of Unflatten from string function, you'll see it is TRUE. That's because it tries to convert a single char from the sring into a 4 byte integer(the constant 1). That doesn't work. If the code tries to check if the first char of the string is \03, then wire a U8 integer at the "type" input of Unflatten from string. If I understand correctly, it seems that this is the code on the server that doesn't work.

Message Edité par Jean-Pierre Drolet le 05-06-2005 08:14 AM



LabVIEW, C'est LabVIEW

0 Kudos
Message 2 of 10
(2,812 Views)
I can't change the vi on the server, so what must I do with the data that I send with my VI? or where do I have to place that U8 integer?
0 Kudos
Message 3 of 10
(2,806 Views)
The code shown in ausgang.JPG always outputs 0 for any input string for the reasons I stated before. The I32 diagram constant of value 1 should be corrected to a U8 if you want to output the data on the string.


LabVIEW, C'est LabVIEW

0 Kudos
Message 4 of 10
(2,795 Views)
here is a screenshot of what I mean. I don't have a clue what to write to generate a 3.
also I have to send the data in the same string as that 3, and the 3 on the first place, the data starting from the 2nd place.
0 Kudos
Message 5 of 10
(2,792 Views)

!!!!!!!That doesn't work!!!!!!!!!!!
The output will always be ZERO



!!!!!!!That works!!!!!!!!!!!!

Message Edité par Jean-Pierre Drolet le 05-06-2005 08:47 AM



LabVIEW, C'est LabVIEW

0 Kudos
Message 6 of 10
(2,784 Views)
Wait a minute...

I wrongly assumed that the constant was a I32 because there was no coercion dot on the length input of the string subset function. I just realized that coercion dot does not appear for U8 input either... My mistake.

Then to have a string beginning with the char change the display format to slash codes and type \03 like in the picture I posted. You can also use the hex format and enter 03.


LabVIEW, C'est LabVIEW

Message 7 of 10
(2,769 Views)
I already thought you misunderstood, but who am I to correct you 😃
anyway thank you very much!!!!
I do it like in the next image
0 Kudos
Message 8 of 10
(2,762 Views)
0 Kudos
Message 9 of 10
(2,761 Views)
I'm glad it works but you've said that ( and that's what misled me...) that the result was always zero. That's not the case here since the U8 output is the numeric value of the first char of the string.

Message Edité par Jean-Pierre Drolet le 05-06-2005 04:07 PM



LabVIEW, C'est LabVIEW

Message 10 of 10
(2,742 Views)