2 Analog Temp Inputs, Digital Input And Trending


rdtech

Recommended Posts

I have a project where I am using 2 thermometers, one for ambient (TMP35) 10mv/degree C and a Non-Contact IT thermometer for target temp with a 0-5V structure. I do not think Ill have much trouble scaling the IR therm 0-5.  I need to continually show the ambient temp, and once button is pressed, activate a digital output and start recording the non contact thermometer.

 

We need to show the temperature and how long it takes for the target, monitored by the IR thermometer to return to ambient (or close) and stabilize.

 

Is there an existing script? I have begun with decribing 2 AN inputs 0 & 1 and 1 digital out for start and trugger of external event (classified)

 

I believe I need to start a timer and monitor the IR therm and record until it stabilizes(ambient)

 

I do need to be able to save this data.

 

I am new to DAQ Factory, but some experience with U3 LAbjack.

 

ANy help will be appreciated.

Link to comment
Share on other sites

This is pretty simple.  First, create your channels and make sure you are getting data on the inputs, and that you can set the output manually.  Add any visualization you want for viewing the data.  Then create a logging set to log the non-contact thermometer.  Maybe throw in the other one too if you want.  Finally, in your button, you just need a Quick Sequence action:

 

beginLogging(myLog)

digOut = 1

 

That's it.  Change myLog to the name of your logging set, and digOut to the name of your digital output channel.  You might add a stop button that does the reverse:

 

endLogging(myLog)

digOut = 0

Link to comment
Share on other sites

OK, thanks.. Sounds simple..

 

I was working with the external timer unit (OMRON) last night in the lab, I cannot get an accurate 1-shot ~5V input to my system with th electronics and relay contact within it.

 

I need, when button pushed, to have an open collector fast 0.001ms output to start this sequence. DO I still need to alter it?

 

The customer has specified the 0.001 seconds for a reason (in my mind, too short)

 

Little more help.

 

Mitch

Link to comment
Share on other sites

OK, I already stated part of this in an earlier message.

 

I think since my external .001s timer is not acting how I needed it to, I have to initiate the output pulse with a button and then log IR temp.

 

Would I change this to:

 

digOut = 1  (but add a .001s

 

beginLogging(myLog)

Link to comment
Share on other sites

OK,  I know i sent a separate message. My external timer is not performing as needed and Ill need the software and labjack to initiate the 1ms (.001s) digial output, then start logging IR temp.

 

Do I change the script ro:

 

digOut = 1 (WITH some sort of counter/timer)

then:

beginLogging(myLog) ?

 

It would be nice if I could choose an option to stop the logging and end the file when the IR temp = ambient temp.

 

I hope Im not asking too much, I was expecting the OMRON timer to do it's job.

 

So, in conclusion, I need to send a one shot digital out for 1ms (~5VDC) and start the recording on the IR non contact unit temp. I will like to stop the logging and save it upon IR temp = Ambient temp.

 

THanks in advance.

 

Mitch

Link to comment
Share on other sites

To send a pulse do:

 

digOut = 1

delay(0.001)

digOut = 0

beginLogging(myLog)

 

but I doubt it will be 1 millisecond.  More like 5 because of the communications delay over USB to the LabJack.  You will likely need to setup a LabJack timer to send such a short pulse.  I'll have LabJack reply with the proper setup.

Link to comment
Share on other sites

See the Waveform Generation App Note for an overview of different ways to make a pulse:

 

http://labjack.com/support/app-notes/waveform-generation

 

You could use a timer in one of the PWM modes to make a pulse of the exact length needed, and another timer to stop the PWM after 1 pulse.

 

Or you could use the WAIT technique.  Make a script that looks something like:

 

AddRequest(ID, LJ_ioPUT_DIGITAL_BIT,0,0,0,0)    // Set FIO0 to output-low.

AddRequest(ID, LJ_ioPUT_WAIT,0,1024,0,0)    // Wait 1024 microseconds.

AddRequest(ID, LJ_ioGET_DIGITAL_BIT,0,0,0,0)    // Set FIO0 to input.
GoOne(ID)
ErrorHandler(ID)

Link to comment
Share on other sites

The easiest way is to simply put it in the Quick Sequence of the button where you originally had:

 

digOut = 1

 

If the LabJack commands are slow, however, this can cause the UI to pause while the commands execute.  In that case, you put the script in a new sequence, then start the sequence from the button using:

 

beginseq(mySequence)

Link to comment
Share on other sites

OK< this is great so far, all of you guys are VERY helpful.

 

I need to make a "tic" mark on the chart when the "button" is pressed and 1ms or so timer is started. Like a line on an ECG showing a pacer spike.

 

In a perfect world when one of the variables returns to it's "pre" button pressed number (or close to it) It would be nice if the program could see this and stop recording. I will probably need to make some cals after that, but most probably they can be done in Excel.

 

I hope I am not asking too much.  I thought I knew more about the program! This project seems much more complex than controlling an analog output and graphing it.

Link to comment
Share on other sites

If you don't want people to know, you should remove the image associated with your forum login as that shows your company name.  I will remove the signature in your first post too.

 

I've attached a sample on how to add ticks / flags / annotations or whatever you want to call it to the X axis of a graph to mark events.  There are two ways to do it, either with Line annotations, which draw a vertical line at each event (and you can use the same to create horizontal lines for ranges for example), and using axis annotations which draw ticks and only work on the X axis.

 

I used a test digOut channel to mark the event.  In your file you'd probably do the same thing.  Then when you want to mark the start, you just do like I did in the button:

 

flag = 1

 

and the end:

 

flag = 0

 

You can, of course use multiple states and get pretty fancy, but you'd need a Test D to A channel if you are going to use anything more than 0 and 1.

 

 

GraphAnnotations.ctl

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.