LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System Exec VI and CANBus

Hi guys, 

I have a problem in System Exec vi and would be appreciated if anyone can suggest a solution. 

So I use SystemExec vi to load an application called CANopenshell.exe and send a command over a CAN a line. My problem is, the command gets repeatedly sent until I close the terminal manually! Is any  one able to tell why that happens? Command has been given as Standard Input. Please see attached images, as you'd see that, the output, "Write PDO......etc" section has been repeated many times. 

Also, how would I be able to send commands one by one ? 

(Sorry, I had to take some data/parameters off)

Thanks in advance.

 

Capture1.JPGCapture2.JPG

 

0 Kudos
Message 1 of 4
(2,468 Views)

This code snippet isn't in a while loop is it? What happens if you include an end of line character in your command? 

CH
Applications Engineering
National Instruments
http://www.ni.com/en-us/support.html
0 Kudos
Message 2 of 4
(2,427 Views)

Hi Ch, 

No it’s not a loop. I tried the End of line character,didn’t work. Same result.

0 Kudos
Message 3 of 4
(2,422 Views)

Update -

 

Although I haven't been able to find the cause of the problem I had before, I have managed to work around the issue and come up with a solution. 

Basically, I had to use "LV Processes" to feed in multiple commands to the terminal and read stdouts accordingly. System Exec VI can't really handle multiple interactive commands from what I understand. Follow the below link to find the necessary information, huge credit to the creator of this project. !

 

https://forums.ni.com/t5/Community-Documents/LV-Process-Windows-pipes-LabVIEW/ta-p/3497836

 

  

0 Kudos
Message 4 of 4
(2,402 Views)