10-23-2008 02:45 PM
I'm programming C#.Net with Measurement Studio. My app' uses a USB-6501 device of which i'v deployed some digital outputs. Of the various routes that may occur within my app', those outputs can be any state (true/false) due code execution of the app' and at other certain points within the app' the state of those outputs needs to be determined. Ideally, i would like to read the associated task to determine this state; how do i do this?
Thanks,
Glenn
10-24-2008 01:17 PM
Hi Glenn,
I understand that you are developing an application in which you deploy some digital outputs, and you would like to be able to determine the state of those outputs at various points in your application. With the USB-6501, you can configure the digital I/O lines to act as inputs or outputs individually. So you could have your digital output tasks write values to the digital output lines, while you would be running a digital input task on different digital I/O lines to determine the state of the digital lines wherever it may be of interest for you to do so.
Regards,
Wallace F.
10-24-2008 03:38 PM
If I understand your prescription correctly (physically connect two lines whereas one is the subject output and the other is an input that serves as feedback of the said output), I appreciate that method as being an absolute solution. However, I don't have the financial or chronological budget to add more points (i would have to add another module as all I/O of my project is allocated). Respectively, is there an alternative solution that would allow me to read the 6501's output state for a subject line that i write to via a digital output task? e.g. Can i include a digital input task that references a line that i write to from a digital output task?
Thanks,
Glenn
10-25-2008 08:46 PM
Welp, i answered my own question but thanks for the inspiration; i.e. i can associate a DigitalReader and DigitalWriter to the same task and get the results i expect. At least it's working so far in a simple environment; i just tried it for one line/task with only one challenge within the app' ("if output is off" / turn it on). Now i'm off to exploit this with more challenges/conditionals for more lines/tasks; we'll c where it goes!
Thanks,
Glenn
10-27-2008 10:15 AM
Hi Glenn,
I know that you already figured this out, but I just want to confirm that you can read from digital lines that you write to in a digital output task.
Best wishes,
Wallace F.
10-27-2008 12:07 PM