Test and Measurement Forum

USBDrDAQ in Visual Basic

Which product is right for your exact requirements

USBDrDAQ in Visual Basic

Postby armagi » Mon Nov 18, 2013 4:40 pm

Hi,
please, what must be the output when I call the subroutine USBDrDaqDO(handle,3,3)?
Could you give me the correct statement to Declare this routine?
Thanks!
Armando
armagi
Newbie
 
Posts: 0
Joined: Tue Sep 17, 2013 5:10 pm

Re: USBDrDAQ in Visual Basic

Postby Hitesh » Mon Nov 18, 2013 5:30 pm

Hi Armando,

That will turn on IO channel 3 and will output 3.3V on that channel.

Please try the following to set the channel:

Code: Select all
Declare Function UsbDrDaqSetDO Lib "USBDrDAQ.dll" (ByVal handle As Integer, ByVal IOChannel As Long, ByVal value As Integer) As Long


EDIT: Function call updated

Hope this helps.
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: USBDrDAQSetDO in Visual Basic

Postby armagi » Tue Nov 19, 2013 3:50 pm

Hello,
thanks for the answer!
I modify slightly my Declaration statement, following your indication, but nothing change.
A 3 V LED is wired into channel 3. I'm using this approach inside your GetData macro:

Declare Function UsbDrDaqSetDO Lib "USBDrDAQ.dll" (ByVal handle As Integer, ByVal IOChannel As Long, ByVal value As Integer) As Long

Call UsbDrDaqSetDO(handle, 3, 5)

Hardware is OK. I have tested all the four I/O channels with PicoScope.

Please, there is another way to call this routine?

Best regards and thanks again!!

Armando
armagi
Newbie
 
Posts: 0
Joined: Tue Sep 17, 2013 5:10 pm

Re: USBDrDAQ in Visual Basic

Postby armagi » Tue Nov 26, 2013 7:51 am

Hi,
following your indications I solved my problem of using I/O digital channels. I contacted the Support because the usage of those channels is not extensively described in the documentation, contrary at the very good presentation of the EXT inputs channels.
If the aim of the work consist of:

-measure some thing via the internal sensors of the Logger or through the EXT input channels,
-elaborate the so acquired information, and take a decision,
-translate that decision into an output signal or command,

from the result of my experience all these steps must be followed. I give them in scholastic mode:

Hardware
1. connect the Logger to the computer,
2. switch on the Logger if necessary;
Software
3. declare all the routines that will be called in the procedure looking at the
Format established into the DLL library,
4. call a routine to open the Unit in order of put it in conditions of
accepting commands,
5. verify that the Unit was open,
6. call a convenient routine for input the required information,
7. give enough time to the system for putting all the necessary operating
sequences into the stack,
8. call the DrDaqRun() command to execute the so given machine
instructions,
9. process and elaborate the arrived information from the external world,
10. take a decision and produce an output,
11. call a routine to put into the stack the sequences required to send-out
the signal or command so elaborated,
12. call the DrDaqRun() command to execute those instructions present
into the stack,
13. verify that the output action was executed by seeing or hearing a signal
arriving from some external device,
14. wait all the required time for a useful employment of the output action,
15. close the relative output routine,
16. close the Unit in order to live it in conditions of accepting further
commands by empting the stack.

I hope these statements could help some neophyte like me.

Sincerely

Armagi
armagi
Newbie
 
Posts: 0
Joined: Tue Sep 17, 2013 5:10 pm

Re: USBDrDAQ in Visual Basic

Postby Hitesh » Tue Nov 26, 2013 11:37 am

Thanks Armagi,

There was an error in the snippet of code which I will update.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire


Return to Pre-Sales Advice

Who is online

Users browsing this forum: No registered users and 0 guests