07-07-2016 02:00 PM
Hi, I am a bit puzzled, thinking this may have to do with special characters???
I have a command
echo -n -e '\040' > /dev/...../uledw
that should be basically turning on an led on a linux board, if I use teraterm it works
if I use labview -actually teststand calling a serial write in labview vi- (and I am monitoring with a port sniffer)
it passes the command, but it does not get executed.
I know this may not be detailed enough, but hopefully enought to get a conversation started.
before - I would create an .sh file, transfer it to the linux environment and execute it there, but I am not permitted to this now. Is there a way?
Solved! Go to Solution.
07-07-2016 02:20 PM
My gut instinct after reading your post was to open up an SSH session. A Google search returned this:
https://decibel.ni.com/content/docs/DOC-41388
Not sure if it will help, but it might be a place to start.
07-07-2016 02:53 PM - edited 07-07-2016 03:21 PM
I must add, that all other commands work just fine
Also, I am terminating with EOL
07-07-2016 02:57 PM
EOF is end of file.
Perhaps you should be using new line/line feed (ASCII decimal 10) or carriage return (ASCII decimal 13).
07-07-2016 03:12 PM - edited 07-07-2016 03:14 PM
typo, sorry EOL*
but I have tried LF and CR and I repeat all commands work, there is something in the way Labview Visa is enterpreting the command in question.
07-07-2016 03:25 PM - edited 07-07-2016 03:26 PM
What if it is a CR followed by LF, or LF followed by CR?
Are you sure you have the serial port settings matching what works on teraterm?
Do you get any errors in LabVIEW? Such as you might get if you left the port open in teraterm while trying to run the LV program?
LabVIEW and VISA doesn't do anything special for "interpreting the command in question". It just sends out what you tell it. It just sends out the data you tell it. You said you port sniffed on the serial write in LV. Have you port sniffed when it worked in teraterm? Any differences?
In teraterm, are you just typing in the command? Is it possible that the linux board likes to get the data only so fast and that if you are typing it, it is slow enough. But if you send the entire string in one swoop using the LabVIEW command, it is too fast? Perhaps the linux board has a tiny buffer or prefers a larger delay between bytes? If so, you could try sending the VISA write one byte at a time in a loop with a small delay.
How did you put the line feed character into your VISA write command?
Can you attach your VI?
07-07-2016 03:47 PM - edited 07-07-2016 03:48 PM
What if it is a CR followed by LF, or LF followed by CR?
The rest of hundreds of commands work
Are you sure you have the serial port settings matching what works on teraterm?
Yes, see answer above above
Do you get any errors in LabVIEW? Such as you might get if you left the port open in teraterm while trying to run the LV program?
No, TeraTerm is closed, only the port-sniffer is open and it's ok
LabVIEW and VISA doesn't do anything special for "interpreting the command in question". It just sends out what you tell it. It just sends out the data you tell it. You said you port sniffed on the serial write in LV. Have you port sniffed when it worked in teraterm? Any differences?
Yes, I see differences, even when the echo is off it seems like the sniffer is still seing the echoed charaters, when using teraterm, but not when sending through the VISA Write
In teraterm, are you just typing in the command? YES Is it possible that the linux board likes to get the data only so fast and that if you are typing it, it is slow enough. It's possible, but how come other commands are fine? But if you send the entire string in one swoop using the LabVIEW command, it is too fast? Perhaps the linux board has a tiny buffer or prefers a larger delay between bytes? If so, you could try sending the VISA write one byte at a time in a loop with a small delay.
How did you put the line feed character into your VISA write command? Concatanated the EOL constant
Can you attach your VI? see snip of the valid section. Just to reiterate: hundreds of commands work, it's something with the echo keyword - is my gues.
07-07-2016 04:08 PM
I've got no answers or more questions.
It doesn't make sense. You said all other commands work. And you aren't seeing differences in what tera term sends out vs. LabVIEW. Yet this one command works in one and not the other. If there are no differences, then there is no reason for it to act differently.
07-08-2016 02:17 AM
@RavensFan wrote:I've got no answers or more questions.
It doesn't make sense. You said all other commands work. And you aren't seeing differences in what tera term sends out vs. LabVIEW. Yet this one command works in one and not the other. If there are no differences, then there is no reason for it to act differently.
There's one more thing that could be wrong:
The command may not work!
07-08-2016 07:12 AM
Bill, command works - typed up from tera-term does what it needs to