LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with reading information coming from a software into LabVIEW through Serial port

Hi,

 

I am new to LabVIEW and also an amateur in using RS232 for communication. I have this software that has these icons like speed increase/decrease, elevation up/down, start/stop. Now, when I click these buttons on the software, they perform the appropriate functions. For example, if I press start button, the signal must go through a serial COM port into LabVIEW to start the machine. How do I do that? How do I find what format the code word is when I press a button on the software? And how to decode the information to read whether the button pushed is start etc...? Any help would be appreciated.

 

I may not be perfect, but I'm all I got!
0 Kudos
Message 1 of 66
(3,585 Views)

That information would be in the programming manual for the device you're controlling. Unless you have a device that has no documentation or you cannot get the documentation that's the first place you should look. If you cannot get the documentation at all then you've got some reverse-engineering to do. To do this you will either need a serial port sniffer (a hardware device), or you can try to use a software-based port capturing program. On Windows PortMon is the most prevalent. This will show you how the port was configured (baud rate, stop bits, etc). Warning: the information is technical.

 

As far as how to get it running in LabVIEW, you should take a look at the serial port communication examples that ship with LabVIEW. The most problems occur in figuring out how to (a) terminate a write command, and (b) determining when to stop reading. For (a) this is typically done by appending a carriage return or linefeed to the command. This is device dependent. For (b) this is usually done by the byte stream ending with a character like a linefeed. Again, this is device-dependent. 

 

You may also want to peruse this KB article: Serial Instrument Control Tutorial. There are also lots of tutorial on the internet for basic tutorials on serial port communication.

Message 2 of 66
(3,569 Views)

The software actually controls a treadmill. But, the device I am trying to control is a newly created treadmill similar to one that is available in the market. There is documentation to control the one that is available in the market, but to control the one that has been invented, that is my job. For now, we manually control the new treadmill with LabVIEW. But what I have to do is to control the New treadmill with options available on the commercially available software. If I have made it clear for you. I see what you are saying. Thanks! I am going to look into PortMon. But if you have more ideas, please let me know.

 

 

 V 

I may not be perfect, but I'm all I got!
0 Kudos
Message 3 of 66
(3,561 Views)

VeeJay wrote:

... Thanks! I am going to look into PortMon. But if you have more ideas, please let me know.

 

 

 V 


Saverio gave you good suggestions. I reverse engineered a serial protocol abou three weeks ago and Portmon was the key that opened up the handshaking for me.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 66
(3,551 Views)

Ben wrote:

VeeJay wrote:

... Thanks! I am going to look into PortMon. But if you have more ideas, please let me know.

 

 

 V 


Saverio gave you good suggestions. I reverse engineered a serial protocol abou three weeks ago and Portmon was the key that opened up the handshaking for me.

 

Ben


I used Advanced Serial Port Monitor to snoop the port on one of our devices.  I was able to get the results I needed but there was an obvious conflict as the computer occasionally crashed while using this software. m

0 Kudos
Message 5 of 66
(3,530 Views)

Hi everybody,

 

I tried Portmon. This is what's happening. Now, The device is not connected to the PC's serial port, hence, The software gives an error saying "No Communication with said device". How do I trick the software to accept the connection without actual physical connection between the PC and the device? The reason I want to do this is I want to use PortMon to sniff the codes out from the appropriate buttons on the software so that I can send them to LabView to do the said operation. 

 

I may not be perfect, but I'm all I got!
0 Kudos
Message 6 of 66
(3,502 Views)

THe Portmon suggestion will typically only work if you have an operational device talking to the other software.

 

Of course I could be missing something...

 

Is ther any reason why you don't want to hook of the device?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 66
(3,497 Views)

Is ther any reason why you don't want to hook of the device?

 

Ben

 

_________________________________________________________

 

Thanks for the reply Ben!

 

First, The device is a big one and I cannot bring it into the lab.

Second, I am currently just trying to understand what information goes out from the PC, when using the icons in the software.

Third, The device is newly engineered. So, it has still not been programmed to send status back to the software. The statuses have to be issued from the variables it is measuring through "LABVIEW"

 

Hope I have made things clear!

 

I may not be perfect, but I'm all I got!
0 Kudos
Message 8 of 66
(3,494 Views)

How about hooking up an old style treadmill then?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 66
(3,489 Views)

I wish I could. But, I don't have access to it. 😞 . I have the INPUT commands and Status Requests (Both commands and ACK's) documentation from the controller used in that treadmill. Now, my controller is the PC and LabVIEW for the new treadmill.

 

VJ 

I may not be perfect, but I'm all I got!
0 Kudos
Message 10 of 66
(3,484 Views)