Jump to content
  • 0

USB-1208FS Help


skeeter
 Share

Question

I have a 1208FS and I would like to control pins 21-29. I found some examples in visual basic but run into various errors when I attemt to run them. I am more familar with Agilent VEE Pro and have some examples for that as well but cannot figure out how to control the outputs of my 1208FS. Can anyone provide some examples in either visual basic, VBA or keysight Vee pro on how to connect to a 1208FS and what commands work to control pins 21-29?

 

Thanks

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hello,

The eight pins you wish to control (21-28) are designated FirstPortA. There are 2 or 3 functions that can be used. First, you must declare the direction as input or output. To do this, use cbDConfigPort. For example, returnValue = cbDConfigPort(boardNumber, FIRSTPORTA, DIGITALOUT). To write the port use cbDOut or DBitOut. For example, returnValue = cbDBitOut(boardNumber, FIRSTPORTA, 3, 1) sets pin 24 high. If you wish to write all eight bits use returnValue = cbDOut(boardNumber, FIRSTPORTA, 85) sets every other line high.

We do not support VBA, but I believe you can call UL functions as long as you import the cbw.bas file into the VBA project. This is the file that declares the FIRSTPORTA and DIGITALOUT enumerations as well as the functions themselves. It is located in C:\Users\Public\Documents\Measurement Computing\DAQ\VBWIN. If you don't have this folder, reinstall InstaCal from the DAQ Software CD download:https://www.mccdaq.com/downloads/MCCDaqCD/mccdaq.exe

good luck!

John

 

Link to comment
Share on other sites

  • 0

Hi John, 

 

I was able to follow you instructions and get all the pins to go high using returnValue = cbDOut(boardNumber, FIRSTPORTA, 85). When I use the DBitOut to get one pin to go high I run into the error attached. Any ideas about how I can fix this?

 

mcc.PNG

Edited by skeeter
Link to comment
Share on other sites

  • 0

Hello,

Using 1 for the logic state works if you're use cbDBitOut and VB6, which is essentially VBA. However, your VEE code appears to use our Dot Net DLL and it functions are strongly typed. Instead of using 1 for the logic state, try the enumeration DigitalLogiceState.High. This is also true if you're using VB.NET (or C#).

John

Link to comment
Share on other sites

  • 0

Hi John,

Your direction have helped me and I have almost completed my program. When I take my program and try using it on a different computer I receive this error. Ive set up the import of the MCCDAQ DLL the same so im not sure what else I can do. Any help is appreciated. Thanks

error.PNG

Link to comment
Share on other sites

  • 0

Install the InstaCal program and run it with the device connected. Make sure the number of input channels are set the way you want, close InstaCal and run your program. If you still get the error, then somewhere in VEE you need to declare or include our MCCDAQ.DLL, which is the .NET componet.

best regards,

John

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...