LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sending and 'echo -n -e '\040' > /dev/..... to a Serial Linux device

Solved!
Go to solution

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?

0 Kudos
Message 1 of 15
(4,601 Views)

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.

0 Kudos
Message 2 of 15
(4,597 Views)

I must add, that all other commands work just fine

 

Also, I am terminating with EOL

0 Kudos
Message 3 of 15
(4,587 Views)

EOF is end of file.

 

Perhaps you should be using new line/line feed (ASCII decimal 10) or carriage return (ASCII decimal 13).

0 Kudos
Message 4 of 15
(4,583 Views)

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.

0 Kudos
Message 5 of 15
(4,579 Views)

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?

0 Kudos
Message 6 of 15
(4,567 Views)

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.

0 Kudos
Message 7 of 15
(4,557 Views)

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.

 

 

0 Kudos
Message 8 of 15
(4,546 Views)

@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!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 15
(4,516 Views)

Bill, command works - typed up from tera-term does what it needs to

0 Kudos
Message 10 of 15
(4,499 Views)