Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog input not reading properly in normal mode

Solved!
Go to solution

HI

I trying to acheive a simple test by using Keithley KUSB-3102 as interface which sends a Dout of +5v and reads it on the Ain. The outer circuit consist of an mosfet as a switch which turns the +12v on/off to a relay and yeah I'm new to LabVIEW environment. 

The VI is attached. When I'm running this VI in Hightlight mode the graph & LED works fine, showing all the values and the circuit is working fine as well. But when I move it into normal mode the circuit still works fine but the values are not shown on the graph or the LED turns on once only.

Now what I beleive is that it needs a delay before the next loop but I can't acheive it I have tried other VI's provided by Keithley such as trigger and delay but it gives error which I can't understand why and hv tried the normal delay as well but no luck. May be i'm missing something not sure.      

 

Kind Regards

 

0 Kudos
Message 1 of 4
(3,794 Views)
Hi Code5862,

This seems like an interesting issue.

One thing I would like you to add, is some timing to this vi. At the moment, the while loop will try and iterate as fast as it physically can, which will mean that it would completely run your processor at 100% which is not ideal.

We can use the Wait function, or the Wait until next multiple function. This can be found in the timing palette, which is located under Programming > Timing.

The differences between these two functions are explained in the following KnowledgeBase article (0EF854SG)

Also, how many times do you expect the LED to turn on? The timing vi's should help you with your timing issue.

Please let me know how you get on, and thank you for using the NI forums!
Ashish Naik
Automotive Business Development Manager
National Instruments UK
0 Kudos
Message 2 of 4
(3,769 Views)

Hi Code5862,

 

I was wondering how you were getting on, and if this solved the issue. 

 

Kind regards,

Ashish Naik
Automotive Business Development Manager
National Instruments UK
0 Kudos
Message 3 of 4
(3,740 Views)
Solution
Accepted by topic author Code5862

I was connecting it the wrong way, I connected the delay outside/inside the loop which was having very little effect on it. But the Wait Until Next ms Multiple function was the right one to use inside the loop. I'm now taking one complete cycle per 400ms to read the Ain and is showing 4.8V - 4.7V which is fine.

Thanks.

    

0 Kudos
Message 4 of 4
(3,726 Views)