07-27-2017 08:27 AM
Disclaimer: I am very inexperienced w/ labview and only a beginner so please be patient with me.
I am trying to control a TEMPCO TEC-9100 Temperature Controller using labview. The controller uses MODBUS to communicate. I currently have it connected through a serial connection to my computer (through a serial to USB adapter). I have confirmed that there is connection between the controller and my computer. Now I would like to create a labview program that will allow me to control the controller from my computer.
Please let me know if you can help and please share all helpful resources!!
07-27-2017 08:53 AM - edited 07-27-2017 08:55 AM
For basic serial communication, I always start with the Simple Serial example found in the Example Finder. Go to Help >> Find Examples and search for Simple Serial. It is a basic VI that sends some data to a serial port, waits, then reads it back. A more advanced design will implement either asynchronous communication with terminating characters, or timeouts to know when the data is done being received.
That being said there are tons of Modbus APIs written for LabVIEW that might make life easier for you if you can understand how to use the API. It will attempt to make a higher level calling to the device so you don't need to worry about the raw bytes going out or in. Some people like this, but debugging problems with communications can be harder. If you search your palette for Modbus you may already have one of these APIs installed. These usually come with examples, but if it doesn't they are usually easy enough to use with an Open, Read, Write, Close concept. For me I use the Modbus library under Data Communication >> Modbus, but I'm not sure if that gets installed with the base LabVIEW or if it came when I installed real-time.
As for basic LabVIEW training, here are some links to free online training usually seen on the forums.
-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)
Learn NI Training Resource Videos
6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-27-2017 10:09 AM
Although I can communicate with the device through the software given by the manufacturer and control the temperature effectively from my computer (so I know the serial communication is running correctly) ,when I test the serial connection using the Simple Serial VI you mentioned, I get an error "Error -1073807246".
I have closed all other programs and restarted labview before testing, and I still get the same error. Does this mean that labview cannot communicate with my device?
07-27-2017 02:18 PM
@wakho wrote:
Does this mean that labview cannot communicate with my device?
No, it means LabVIEW cannot communicate with your COM port. Some application is running that is locking that resource.
Although I can communicate with the device through the software given by the manufacturer...
Is this software closed? Because this will also prevent LabVIEW from accessing it. Is MAX open with a test panel to the VISA resource? Because this will also prevent LabVIEW from accessing it.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-28-2017 07:53 AM
No, I closed all programs, including labview, and then tried testing it again. Still getting the same error....Not sure why
07-28-2017 12:10 PM
I don't have it open anywhere else, I even restarted labview and still getting the same issues. Through the Modbus I/O Server for the attribute "Commfail" I am getting it to be true, meaning there is no connection. Could this be because of my rs232 Serial to USB converter I am using? Again, the simple serial test is also still not working.
Thank you so much in advance!
07-28-2017 01:28 PM
It might be the USB converter. They were notorious for flaky behaviour in the past but they're much better these days at truly replacing all the functionality of a real PC COM port.
If you post your code we can take a look and tell if you've just made a simple LabVIEW error or set up your RS-232 parameters wrong.
For MODBUS I always just use the NI MODBUS Library available in the VI Package Manager.
07-28-2017 01:45 PM
I'm currently not getting that error anymore but I am still confused as to whether connection between the device and labview is present or not. I am trying to test the connection using the simpleserial.vi as well as Continuous Serial Write and Read.vi but when I run both I don't get any results. Also when I run the continuous test I get a timeout error. (As seen in the picture below) This leads me to believe that labview cannot connect to the Serial Port.
07-31-2017 09:19 AM
I am looking to control a Tempco TEC-9100 temperature controller using labview. I have established connection between the device and my computer through a RS-232 to USB converter.
When I attempt to run anything through Labview, I am not sure whether or not there is connection between Labview and my controller (which I think may be due to the USB converter).
Once I can establish connection within Labview, I would like to use the NI MODBUS Library to create a simple program that will allow me to control the temperature of the device.
Thank you in advance!!
07-31-2017 09:23 AM
Hi wakho,
I am not sure whether or not there is connection between Labview and my controller
When you are unsure you need to check/test this connection…
I would like to use
That's ok. Do whatever you like to do! 😄
What exactly is your (LabVIEW) problem?