06-30-2005 12:55 AM
06-30-2005 04:14 PM - edited 06-30-2005 04:14 PM
Message Edited by Tom W. on 06-30-2005 04:17 PM
07-01-2005 11:57 PM - edited 07-01-2005 11:57 PM
Message Edited by Rolly on 07-02-2005 02:03 PM
07-02-2005 09:41 AM
07-02-2005 11:45 AM
if (UserHookDataPtr->ProcessedImageCount == 10)
{ DAQmxCreateTask("",&taskHandle);
DAQmxCreateDOChan(taskHandle,chan,"",DAQmx_Val_ChanForAllLines);
DAQmxStartTask(taskHandle);
DAQmxWriteDigitalScalarU32 (taskHandle, 1, 10.0, 1, NULL);
DAQmxClearTask(taskHandle); }
//NI trigger relay OFF (Open)
if (UserHookDataPtr->ProcessedImageCount == 40)
{ DAQmxCreateTask("",&taskHandle);
DAQmxCreateDOChan(taskHandle,chan,"",DAQmx_Val_ChanForAllLines);
DAQmxStartTask(taskHandle);
DAQmxWriteDigitalScalarU32 (taskHandle, 1, 10.0, 0, NULL);
DAQmxClearTask(taskHandle); }
07-02-2005 11:45 AM
However I would like to simplify and combine them together as:
//NI trigger relay ON & OFF
if (UserHookDataPtr->ProcessedImageCount == 10)
{ DAQmxCreateTask("",&taskHandle);
DAQmxCreateDOChan(taskHandle,chan,"",DAQmx_Val_ChanForAllLines);
DAQmxStartTask(taskHandle);
DAQmxWriteDigitalScalarU32 (taskHandle, 1, 10.0, 1, NULL);
[Timer to wait 500 millisecond];
DAQmxWriteDigitalScalarU32 (taskHandle, 1, 10.0, 0, NULL);
DAQmxClearTask(taskHandle);}
Is this possible? and what timer should I use?
Thank you!
07-06-2005 03:07 PM
07-06-2005 09:22 PM - edited 07-06-2005 09:22 PM
Message Edited by Rolly on 07-07-2005 11:26 AM
07-07-2005 03:19 PM
Hi Rolly-
As mentioned in my last post you will still need to address the lines as "DevX/port0" to control the relays. As you have seen there will be errors if you attempt to access them by their "SCC1ModX" identifiers.
When you use "DevX/port0" with the "DAQmxWriteDigitalU32" function to write an entire port value for the lines you would like to control. This will give the best simultaneous control between the lines and will be the best method. This can be accomplished by writing a port value such as 0b11111111 (i.e. 0d255 or 0xFF) to write a "high" to each line or write highs and lows only to the appropriate lines. As mentioned before the port0 lines will control the relays in ascending order beginning with slot J9.
I hope this helps.