LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading from CO2 sensor connected to the PC

Solved!
Go to solution

I can see two obvious problems:

 

1)  You are trying to convert the VISA reference to a string instead of the data from the port you've just read.  Connect the Response string to your Scan to String VI.

 

2)  You forgot to connect the data out wire to your chart.

 

EDIT:  3)  Smiley Frustrated  I have to learn to post faster. 

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 11 of 63
(1,707 Views)

Hi GerdW

 

Could you maybe show me how you were thinking it should be wired? Even if I wire it to the read string it wont show anything. I am really new to labview and have very limited experience. You probably hear that alot.

 

Greetings

DP

0 Kudos
Message 12 of 63
(1,700 Views)

Hi DP,

 

you forgot to convert your VI to LV2014 - but you already got visual suggestions you can follow…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 63
(1,699 Views)

I have tried to wire it as you guys has showed but it is not showing anything on the chart as mentioned earlier. Even if I do as you say. What am I doing wrong? 

I attached the VI two posts ago. Would be really sweet if you could point out the error.

 

Greetings 

DP

0 Kudos
Message 14 of 63
(1,685 Views)
I did point out the error. See my post at the bottom of the first page.

Most importantly - TAKE SOME TUTORIALS. You would very quickly learn about some debugging techniques like using probes to see what data you are receiving etc. There are many free resources available.

(NIquist's suggestion of wiring the 'Response' to the scan from string is actually incorrect - the 'response' maintains a buffer of all of the serial data received and the scan from string will probably fail.)

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 15 of 63
(1,667 Views)

@Sam_Sharp wrote:
I did point out the error. See my post at the bottom of the first page.

Most importantly - TAKE SOME TUTORIALS. You would very quickly learn about some debugging techniques like using probes to see what data you are receiving etc. There are many free resources available.

(NIquist's suggestion of wiring the 'Response' to the scan from string is actually incorrect - the 'response' maintains a buffer of all of the serial data received and the scan from string will probably fail.)

You are indeed correct.  I generally prefer using a shift register over the feedback node so I mis-read the functionality.  I must admit though, this is one of the places a feedback node is actually more intuitive.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 16 of 63
(1,665 Views)

Hey Sam

 

I am still learning and trying to read up on stuff as I am trying to solve specific problems. I am pretty much self taught so my knowledge is pretty limited and that is why I am trying to get help to understand how things work. I did wire it up as you suggested (see attachment) but somehow I am still not getting any data displayed on the chart.

 

Greetings

DP

0 Kudos
Message 17 of 63
(1,648 Views)

Hi DP,

 

did you test with some probes?

 

What is the string reading?

Is there an error from ScanFromString?

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 18 of 63
(1,642 Views)

Hey GerdW

 

Sorry for the late response. Yes, I probed and I also got an error on running (error 85) which is telling me that scan failed and that the input string does not contain data in the expected format. When I clicked the error link nothing showed up.

 

Greetings

DP

Download All
0 Kudos
Message 19 of 63
(1,633 Views)
Solution
Accepted by topic author DP123

Your first Z has a space in front of it.  That is causing error 85.

 

Do you really want to build up one long string of all the responses?  You are only ever going to return the first response in that long string.  You should not be using either a feedback node or a shift register in there.  Just read the data.  Use the Scan From String on the data that comes out of the VISA read, not on the build up string of data.

Message 20 of 63
(1,616 Views)