03-10-2009 08:30 AM
Hello,
I am beginning a new project that will have a single serial port. I would like to use Labview to analyse multiple singles (which include two temperature measurements, two pressure measurements, and a couple of others like two voltages, shaft encoder input, etc..).
Where should i start? I understand RS-232 fairly well, but not as familiar with Labview. How do i break apart the input to seperate the multiple inputs?
THank you all in advance for all the help you provide.
Solved! Go to Solution.
03-10-2009 10:15 AM - edited 03-10-2009 10:17 AM
03-10-2009 10:21 AM
Arrgh. Problems posting.
You must be using a single instrument since you have only one serial port so how the instrument is formatting all of it's datra is going to be defined in it's manual. You haven't provided the make and model of the instrument but I would recomend you look first for an instrument driver.
Before trying to write any code, I would recomend you debug the connection with a program like Hyperterminal and you would also get familiar with the commands/responses from the instrument. Then you can try the shipping examples in LabVIEW for serial communication.
03-11-2009 01:12 PM - edited 03-11-2009 01:14 PM
Hey deperkin,
Just to expand on what Dennis has already said, one of the examples that would be a good starting point for doing serial communication in LabVIEW is the Basic Serial Write and Read.vi example. You can find this example in the NI Example Finder. To open the example finder, open up LabVIEW and navigate to Help -> Find Examples... From here, verify that the Browse tab is selected and navigate to Hardware Input and Output -> Serial -> Basic Serial Write and Read.vi
If you have the make and model of your device, you might be able to find an instrument driver that we provide for this device. You can search for instrument drivers through LabVIEW by going to Tools -> Instrumentation -> Find Instrument Drivers... or by going to www.ni.com/idnet and searching for the drivers there
03-11-2009 07:49 PM
Thank you both very much. I will do this.
Just to clarify a little more on my project:
I am using a PIC to control a solar tracker that will be used for steam generation.
This will include the following data that need to be transmitted over 1 serial port:
2 analog temperature sensors,
2 light sensors (in my case 2 GaP LED's used for measuring light),
1 analog pressure sensor,
1 rotary encoder,
1 Real-time clock
The PIC will be controlling the motor as well as the flow of water for the steam generation cycle.
Non of the parts are purchased yet, and i am specifying to my team to use I2C ready parts so we could use a bus.
What i would like to do is use Labview to view (not write to) the data and i need to seperate the data stream into the appropriate parts in order to graph them seperately.
I will look into what you both said and go through he tutorials. I am not entirely new to Labview, but have never used much of the DaQ tools or serial port tools.
I know that there are some nice parts that we could buy from NI, but with budget constraints i believe we will have to hold off for now and try to primarily use the serial port.
Thank you again for all of your help.
BR,
Deperkin.
03-11-2009 09:42 PM
03-12-2009 08:27 PM
Yes you are correct here. The plan is to connect the multiple sensors using I2C up the the PIC and the then send one single via 232 to Labview and seperate the signal into parts... i was thinking for example:
CR
Signal1_label
Signal1_data
CR
Signal2_label
Signal2_data
CR
Signal3_label
Signal3_data
CR
.
.
etc.
each of these being single byte lines.
Then if possible to seperate these in Labview for a few graphs.
03-12-2009 08:29 PM
Yes you are correct here. The plan is to connect the multiple sensors using I2C up the the PIC and the then send one single via 232 to Labview and seperate the signal into parts... i was thinking for example:
CR
Signal1_label
Signal1_data
CR
Signal2_label
Signal2_data
CR
Signal3_label
Signal3_data
CR
.
.
etc.
each of these being single byte lines.
Then if possible to seperate these in Labview for a few graphs.
03-13-2009 09:27 AM