Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

digital output

I'm new to digital output. I just want to turn something on for 2 seconds. I can turn it on thru MAX, but having trouble with the command in VB. The example uses the following code:

' configure and start the output
CWDO1.Configure
CWDO1.Write data
CWDO1.Start

Where data is an array. Can i just use "cwdo1.write true"? I know I will have use a loop or something to leave it on for 2 seconds. I think all of my properties in my DO object on my form are set like the ones in the example. Any suggestions. Seems like it should be pretty easy.

thanks,
Brian
0 Kudos
Message 1 of 2
(3,156 Views)
I know that I had succuss outputting to the DO pins by using a single number. Each pin is basically a binary number slot. If you want to write to pin 0, then the number you would write is 1 (2^0 = 1). If you would like to write to pin 3, then the number you would write is (2^3 = 😎

So here's an example of writing 5V to pin 2 for 2 seconds:
CWDO1.Configure
CWDO1.Write 4 '(pin 2 - 2^2 = 4)

'When you want to put it back to 0
CWDO1.Write 0

you might use a sleep(20000) method, search for this on Google if you need it.
0 Kudos
Message 2 of 2
(3,156 Views)