Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample Rate of NI 9472 DAQ being slowed by an unknown variable

Hello,

 

I would like to first state that I am very new to LabView and DAQ devices.

 

I am having an issue that concerns the NI 9472 DO DAQ device.  I am using this to control a heating element using PWM.  I read the element temperature using a type-K thermocouple wired to the NI 9219 AI device.  Using a PID loop I acquire my DC %, and from that % value I can use PWM.  

 

The issue is this: when I run my VI, the PWM graph shows no signs of functionality.  At first it did work, but was very slow.  My solution was to create a separate while loop and this fixed the issue.  Though upon completion, it didn't work, but was able to run.  

 

I tried deleting the Analog to Digital VI as well as the DO DAQ Assistant, and that solved the issue.  But obviously I need those functions in order to achieve desired results.

 

I'm thinking the issue lies within the DAQ device or my chosen method of going from digital waveform (source) to the 1D array digital waveform (sink) when connecting the A to D VI to the DAQ Assistant.  

 

Any ideas?  I'm sorry if this is confusing, I'm still learning very much.  

 

Thanks!

 

0 Kudos
Message 1 of 6
(2,400 Views)

Hi Fowlerd8,

 

Can you clarify this behavior you are seeing a little more.

 

1. With the two separate tasks and loops, as shown in the screenshot, is this when the devices are functioning but slowly?

 

2. When you say this is working slowly, are the updates on the PWM output graph occurring slowly or am I misunderstanding this?

 

3. How do you have the DAQ Assistant for each task configured? (If you can attach the code here that too would be helpful.)

 

Thanks!

 

Tyler C.
Technical Support Engineering
National Instruments
0 Kudos
Message 2 of 6
(2,362 Views)

Hi Tyler,

 

I think I may have solved the problem, as I modified the VI quite a bit.  However, I may have expected different results..

 

1.  Yes, the devices were functioning but slowly being in 2 different while loops.  It may have had something to do with the 16 bit resolution being default on the analog to digital VI, but I got a channel error when I ran the VI, so I changed the resolution to 8 bit to match the number of channels and that seemed to work, but was very slow.  If I deleted the DAQ Assistant (not DAQ Assistant 2, they're backwards for some reason) as well as the Array append and analog to digital VI, I got extremely fast and accurate results from the PWM waveform graph.  So the analog to digital VI or the DAQ assistant seemed to inhibit data collection.  

 

2. Yes, it was the updates on the PWM output graph that was occurring slowly.

 

3.  Attached is the updated VI as well as the DAQ configuration for the AI NI 9219.  I have a type-K thermocouple hooked up to it.  

 

 

 

Download All
0 Kudos
Message 3 of 6
(2,356 Views)

From this VI I get a variable pulsating voltage between 1-24V from the NI 9472 D.O. depending on the DC.  If I have 50% DC, I'll get 12-13V.  However, I was expecting pulses of 5V or 0V, with widths depending on the DC of course.  This way I would be able to switch an SSR quickly on/off that controls the line voltage to my heating element.  I had an idea of perhaps 100ms period, and then the duty cycle calculated from my PID would dictate the PWM.

 

Is there a way to do this by slightly adjusting my code?  Or start from scratch?

0 Kudos
Message 4 of 6
(2,354 Views)

Hi fowlerd8,

 

When you are reading 12-13V at 50% DC, how are you getting this reading? Is this a physical reading from the output on the device or the PWM Output Graph in your code?

 

Additionally, how have you wired your device and your external power supply to the 9472?

 

Thanks,

Tyler C.
Technical Support Engineering
National Instruments
0 Kudos
Message 5 of 6
(2,339 Views)

Hi Tyler,

 

I think I figured everything out.  I was reading the 12-13V from an integrated multimeter which makes sense because it's taking the area of the "on" portion of the period.  I verified the pulses with a digital oscilloscope.  I am now able to power everything up and control the SSR as needed.  Thanks for your time and help!

0 Kudos
Message 6 of 6
(2,325 Views)