06-30-2005 12:55 AM
06-30-2005
04:14 PM
- last edited on
08-19-2025
10:26 AM
by
Content Cleaner
Hi Rolly-
The SCC-RLY01 is just controlled by the digital lines of your DAQ board on port 0 as explained in the SCC-RLY01 User Manual on pages 3-4.
Examples for controlling the digital lines in C++ install automatically with Measurement Studio in the "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Generate Values" directory of your hard drive. Pertinent examples are "Write Dig Chan" and "Write Dig Port."
I hope this helps!
EDIT: Please make sure you are using NI-DAQmx 7.1 or later.
Thanks-
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
- last edited on
08-19-2025
10:27 AM
by
Content Cleaner
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.