LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NULL character through TCP

Solved!
Go to solution

I am trying to send a NULL character to my instrument through TCP but have been unsuccessful. Can I send a NULL character with LabVIEW

0 Kudos
Message 1 of 9
(3,876 Views)

You can send anything. Show us some code so we can see what you are doing. And please explain the word unsuccessful, it is way too vague. (Do you get an error? Do you get a different character? Do you get nothing? Timeout? What is the instrument? Does sending other characters work? , etc.)

0 Kudos
Message 2 of 9
(3,860 Views)

I've attached my VI herewith. I'm able to send a string to my hardware but I need each command to end with an ASCII NULL character. For example if I want to send a command  "home" the command should be "home\0". The way the hardware is receiving it is as a slash "\" and zero "0" instead of an ASCII "\0". IS there anyway I can resolve this issue? Thank you very much 

0 Kudos
Message 3 of 9
(3,841 Views)
Solution
Accepted by topic author singith.ab

Your command doesn't show in your VI.  I assume that it is something you entered it in the "Program" string control?

 

That is set for "normal" display.  So if you entered a \0, then you are sending a liter backslash and zero.

 

Change that to \code display and reenter your command.  Then \0 will represent the null character.

Message 4 of 9
(3,837 Views)

Terminate with ASCII NULL.png

0 Kudos
Message 5 of 9
(3,830 Views)

@RavensFan wrote:

So if you entered a \0, then you are sending a liter backslash and zero.


How much is a liter of backslash? 😄

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 9
(3,808 Views)

@Yamaeda wrote:

@RavensFan wrote:

So if you entered a \0, then you are sending a liter backslash and zero.


How much is a liter of backslash? 😄

/Y


LOL.  I guess I cut off the "al" to make "literal".

 

Current market rate is about a $1.55. 

0 Kudos
Message 7 of 9
(3,802 Views)

Hi,

 

in most situation, a string always end up with "\0" to tell the machine the string is finished, which means, in any case you send a string in labview, the machine will receive a NULL or "\0", but never showed.

 

I suppose you want to make something trick to show or to make sure there are different strings you sended, so you want to show "\0" between different strings.

If that's what you want, you can just add "\0", which is two character, and you send the "NULL" successfully.

To be more specific, if you send "This is example string\0" you will be actually sending something like "This is example string\0" + NULL, and the message "This is example string\0" will be showed completely.

 

If this is not what you want, please be more specific.

 

-melonetern

Message 8 of 9
(3,793 Views)

This solution worked perfectly! thanks!

0 Kudos
Message 9 of 9
(3,745 Views)