LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

To read the pressure transducer value using USB 232 serial port?

Solved!
Go to solution

Dear Guys,

 

Thanks for all your answers for my same issue (https://forums.ni.com/t5/LabVIEW/To-read-the-pressure-transducer-value-using-USB-232-serial-port/m-p...)

 

My lab-view run successfully. I have seen the desired response when put the command instruction from the device manual. I am very happy to see that. (Typical Command: *0100P4 and  Response: *000114.71234 where 14.71 is my pressure). I got this response when I connected my device serial connection directly to my computer port). But after sometime I couldnt able to get desired response and I see the following error: 

2.png

Interesting thing I found that, I used to get same error when I using the USB 232 converter to PC port. Then I look to the MAX, I found this..?

1.png

 

I tried to use the following correction:

  • Another program has control over the serial port. Only one program can use the serial port at a time. Close other programs that may be using the serial port, such as HyperTerminal or any NI MAX VISA Test Panels. Automatically close VISA sessions in LabVIEW by navigating to Tools -> Options -> Environment and checking "Automatically close VISA sessions."
  • If you are running an executable built in LabVIEW and LabVIEW is open, LabVIEW may already have control of the serial port. After using a serial VI the default behavior of LabVIEW is to not release the serial port. You can still run another VI using serial from LabVIEW, but not an executable. In order to release the serial port, you must do one of the following:
  • Close LabVIEW. Closing all the VIs that use serial VIs is not enough to release the port. By closing LabVIEW completely, you are force closing all the sessions that have been opened by LabVIEW.

STill I am getting the same error/??? any help

 

 

0 Kudos
Message 1 of 9
(2,348 Views)

I have seen that issue with third party serial adapters....

 

That required a reboot since they did not understand the session being closed down by Putty etc.

 

Ben

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

Hi guy,

 

My lab-view run successfully. … I got this response when I connected my device serial connection directly to my computer port). But after sometime I couldnt able to get desired response and I see the following error

Is there a reason you need to open and close the port for each new sample?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 9
(2,307 Views)

No I am looking the continuous data streaming from the transmitter to the screen. Do you think I should put them in the loop??? 

0 Kudos
Message 4 of 9
(2,269 Views)

Hi skdubey,

 

Do you think I should put them in the loop???

Which loop are you talking about? There's no loop in your image!

 

Open/Close functions usually don't belong into a loop - but read/write operations!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 9
(2,234 Views)

Hey BEN

 

"I have seen that issue with third party serial adapters...

That required a reboot since they did not understand the session being closed down by Putty etc".

Question: Do I need to do all the time restart my pc for the measurement purpose? Is there any other way to figure it out?

 

Hey Gred-W,

"Is there a reason you need to open and close the port for each new sample?"

Question: what do you mean by that open or close for each sample. I refer book which says it's the standard way to read and write for the stand-alone instrument. Is there any other way to write the block diagram for my issue. I think I already provided enough details about my problem. 

 

 

Looking forward to your reply,

 

Kind regards,

skdubey

 

0 Kudos
Message 6 of 9
(2,209 Views)

Hi skdubey.

 

I repeat:

Open/Close functions usually don't belong into a loop - but read/write operations!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 9
(2,198 Views)

@skdubey wrote:

Hey BEN

 

"I have seen that issue with third party serial adapters...

That required a reboot since they did not understand the session being closed down by Putty etc".

Question: Do I need to do all the time restart my pc for the measurement purpose? Is there any other way to figure it out?

...

Looking forward to your reply,

 

Kind regards,

skdubey

 


Only if you have one of those serial adapters that does not understand being disconnected and the session closed.

 

The customer I worked with when I found that situation decided to stick with the crappy serial adapter so in their case the answer is "yes you have to reboot".

 

If it was my decisions, I would toss the bad widget and get a decent one.

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 9
(2,193 Views)
Solution
Accepted by topic author skdubey
I have some doubt about the VI for the Pressure Transducer. 
I refer to your VI and thanks for that .
 
In my VI, I have issue, I use to connect the write buffer directly to the Write Visa Function. It always shown me the error -1073807339. I have tried to trouble shoot. But nothing works out unless I have use Concatenate string and end of line to connect the Write buffer input. String subset function and Fract/Exp String To Number Function are use to plot the data into the graph. It gives me the transmitter data on the waveform graph after writing the command 🙂 (from Device Manual) . ( I got this advice from my senior and my VI is working successfully but I am looking for the reasons????) Please let me know if you have any suggestions on this ..
2.png
more imp Question:
1. Why concatenate the string?
2. Why string subset with 5 as offset.?
0 Kudos
Message 9 of 9
(2,150 Views)