LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ni-9780 Serial Data Read

Solved!
Go to solution

Hi, IM new to all of this but my project is to get this NI-9870 to send at least 5v to a pressure transducer using RS-232 and be able to read the data coming from serial port and convert it into a graph. Unfortunaly I'm having trouble getting the device to even send the correct amount of volts  to get it to work. I have an external power supply hooked up to the NI CRIO 9053 giving at least 10 volts. I get 2.6 at the serial connection and i continue to read nothing at the other end. I have taken a look at different example but am unable to come up with a resolution. If someone would help that would be greatly appreciated. I have attached a picture of the basic VISA VI. Thanks

Capture.PNG

0 Kudos
Message 1 of 8
(212 Views)

Hi New,

 


@New2this101 wrote:

my project is to get this NI-9870 to send at least 5v to a pressure transducer using RS-232 and be able to read the data coming from serial port and convert it into a graph. Unfortunaly I'm having trouble getting the device to even send the correct amount of volts  to get it to work. I have an external power supply hooked up to the NI CRIO 9053 giving at least 10 volts. I get 2.6 at the serial connection and i continue to read nothing at the other end.


Why do you want to send "atleast 5V to a pressure sensor" using a RS232 port?

How do you want to send "that >=5V" using a common RS232 serial port?

Do you know how serial ports actually work? do you know how RS232 ports specifically work?

How did you hook up that external power supply to your cRIO? How is that connected with using a serial port?

 

You really need to learn to ask better questions…

 


@New2this101 wrote:

I have attached a picture of the basic VISA VI.


What's the point of attaching an image of code? (Do you get to a car repair with just a photo of your car?)

Next time please attach a snippet or the VI…

Best regards,
GerdW


using LV2020 on Win8.1+cRIO
0 Kudos
Message 2 of 8
(165 Views)

Well, so your transducer has a serial interface, right?

And it is extremely unlikely that it understands the SCPI command to query an identifier!

What you need to send to a device completely depends on that device. Many T&M devices manufactured in the last 20 years or so have standardized on what is called the SCPI (Standard Command for Programmable Instruments) also often referenced to as IEEE488.2. If an instrument manufacturer uses SCPI or not, how strictly and how much of it is totally up to every manufacturer. Outside of T&M device manufacturers the SCPI standard is unknown and almost never used. Your transducer is NOT a T&M device and therefore extremely unlikely to support that. Most manufacturers anyhow prefer to cook their own soup and come up with their own unique and "totally awesome"TM command set.

 

And what that command set is, is ideally documented in a "Programmers Reference Manual" or some similar document that comes with your device or can be downloaded from the manufacturers site. Some manufacturer do prefer to sell their own "even more totally awesome"TM  software package and treat the command set for their hardware as a carefully protected trade secret. If your device falls under this category, your can consider yourself basically screwed by the manufacture if you try to use that device with anything else than their software.

 

So the first step is to identify the actual device, including manufacturer and device type and version and then locate the documentation for the command set it uses. Once we have that we can start to help you further.

 

Most likely your device uses a specific termination character such as "carriage return" or "line feed" that you will need to configure in the VISA Configure Serial Port function. Then when sending a command to the device according to its documented commands you need to make sure to append that specific character to the end of each command you write to it. The Bytes at Serial Port node in your image can be dropped entirely and you simply pass a number of bytes to read to the VISA Read that is larger than the longest answer you ever expect. VISA Read will terminate when receiving the configured termination character set in VISA Configure Serial Port and return the device response and then you can start to parse that response for whatever information you want to get out of it.

 

I would also recommend you to watch this presentation. It explains a lot about how serial communication with devices generally works.

 

VIWeek 2020/Proper way to communicate over serial 

Rolf Kalbermatter
Averna BV
0 Kudos
Message 3 of 8
(153 Views)

As my name says I'm new to this and need help getting a Setra 267 Pressure Transducer to send readings to a NI 9870 via a Serial Cable using a cRIO-9053. I not 100% familiar on how serial ports work, I do know its connected via pin 1, 4, 9. I hooked up the external power source to the NI 9870 giving it 9volts. I've tried creating a program using VISA and FPGA but unable to get the readings I want. I have attached the VI this time for better analysis.

0 Kudos
Message 4 of 8
(133 Views)

If this is the sensor you are talking about then it doesn't use serial. According to the model number it uses either 4-20ma output or 0 to 5V output. 

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 5 of 8
(125 Views)
Solution
Accepted by New2this101

Even though that device has a DSUB-9 connector, it is not a serial port. As Bob already mentioned, it outputs a voltage or possibly a 0-20mA current on pin 1. Pin 4 needs to be connected to your power supply and pin 9 is the Common (Ground) for both.

Rolf Kalbermatter
Averna BV
0 Kudos
Message 6 of 8
(114 Views)

OK, I realized that now and will attempt to get a new module to work better with this setup

0 Kudos
Message 7 of 8
(109 Views)

This is how you release magic smoke from your device...

0 Kudos
Message 8 of 8
(77 Views)