Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

digital generation with NI 9485 and cDAQ chassis 9172

I am doing a temp control scheme using two 9485 solid state relays for pulse width modulation of the power flowing through some resistive heaters. I've attached a first cut of my code and it contains 2 tasks, one for the analog tempeature measurement and one for the digital generation to the relays. The problem is with the digital generation. I've tried a test vi that simply writes an array of U32s to a single port of one of the relays and the behavior I see on an external scope is not what I am expecting. I would like to know how to simply have a single line output an arbitrary pattern of 1 and 0s using hardware timing. I not really sure which clock to use but I have been using the 20MHz clock as my source. This may be the problem. Otherwise, it has to do with how the data is written.
 
The other issue I've been wresting with deals with the continuous generation. I use a queue to pass data from my temp read loop to the digitial update loop. How do I confirm that previous write is completed before it starts using the new data?  Any help would be appreciated.
 
Thanks
DC
Download All
0 Kudos
Message 1 of 8
(4,305 Views)

Oops, 1 more thing;

LabVIEW 8.5

DAQmx 8.6.1f0

0 Kudos
Message 2 of 8
(4,304 Views)
You don't have to use a clock to control your digital output relays, because it's 'static' output, you must control it in a software timed loop in Labview and not with a buffered generated pulse ... so just create the digital task and directly write on the line or the port in your while loop. I think you can find examples .
Wilfried.
Message 3 of 8
(4,298 Views)

Thanks for the prompt response Wilfried. I am currently implementing an equivalent software timed code. The hardware timing route would have been an easier code job for doing PWM on multiple channels. Now I have to have N parallel loops for each line. My main concern was according to all the documentation I found, these devices are capable of hardware or correlated digital IO when used in the proper slot in the cDAQ 9172 expansion chassis. I never could get this to work in the simplest of scenarios. Perhaps, my confusion lies in what hardware timing is actually supported, single sample or multiple sample generations? When feeding a waveform the last point is the one that seems to get generated. Seems like it supports only single sample generations.

caz



Message Edited by caz on 01-04-2008 09:27 AM

Message Edited by caz on 01-04-2008 09:28 AM
0 Kudos
Message 4 of 8
(4,295 Views)
Yes, you're right, the 9485 module is a correlated module, up to 50 Hz, but I don't understand how it can be used in a real application ... However, 50 hz is rather a small frequency, very closed from the software timed frequency !
Wilfried.
Message 5 of 8
(4,285 Views)
One thing to consider with the 9485 relay module is that its max switching rate depends on both temperature and switching current.  See http://zone.ni.com/devzone/cda/tut/p/id/2988 for more information.
Message 6 of 8
(4,279 Views)
Thanks Chris and Wilfried. I have seen the dependency of switching time to current and temperature. I am using it a current that is below any of the curves up to 100 Hz and I don't want to continously switch it at 100 Hz but rather more like ~1-10 Hz with a variable duty cycle. A PID controller will account for lag in the switching when the duty cycle is really high or low. The buffered hardware timed continuous generation initally seemed like an easy way to independently control the pulse duration of 5 different lines in one of these devices. The generation could just run along happily at an overall cycle frequency of say 10 Hz and when the PID controller running at 1 Hz has some new parameters update the waveforms and let the relays get back to it. The software version of this is messy with N parallel loops for each line that I want to control instead of the clean 1 Channel N samples digital write.
 
caz
0 Kudos
Message 7 of 8
(4,274 Views)

Oh yeah, one more thing;

I still have my armfloats on in the digital pool.

0 Kudos
Message 8 of 8
(4,273 Views)