Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

DIO mask variable in Visual Basic 6.0

Hello. I am attempting to use a Viewpoint systems DIO64 card in a PXI chassis system that is otherwise completely stocked with National Instruments cards. I am attempting to communicate with a breakout box connected to the card using Visual Basic 6.0. Viewpoint offers VB source code for their card, and the code contains functions that I need to be able to use (such as DIO64_Open, DIO64_Close, DIO64_Load, and DIO64_Out_ForceOutput). I have picked apart the code and understand it quite well aside from the "mask" and "maskLength" variables. What do these variables do, and what are their allowed values? I am using a four-port breakout box (designated by the letters A through D), and each port consists of 16 outputs (labeled from 0 to 15). I would like to modify the Viewpoint source code to control the breakout box logic or use other source code to solve this problem (I am currently able to intialize the DIO64 card but am not able to change the output signals). I am certain that my problem resides in the fact that I don't understand the purpose nor the parameters of the mask variable.

Any help would be greatly appreciated.
0 Kudos
Message 1 of 3
(3,904 Views)
nicholson,

It seems like the driver that you are using for the Viewpoint device is not exactly the same as the Traditional DAQ or the NI-DAQmx driver of National Instruments.  I would recommend contacting Viewpoint to find out more about the driver.  Their website is http://www.viewpointusa.com/.  However, If you could provide more information about the particular function and the variables, I could try to take a look at it and see if I can figure something out, as the code might be similar to the National Instruments drivers.  Where exactly are the mask and the MaskLength variables used?

Regards,
Raajit L
National Instruments
0 Kudos
Message 2 of 3
(3,887 Views)
I have attempted to contact Viewpoint for nearly two weeks now, and they have not responded to my calls and emails. The functions in the Visual Basic code are as follows:

Declare Function DIO64_Open Lib "dio64_32.dll" (ByVal board As Integer, ByVal DIOio As Integer) As Integer

Declare Function DIO64_Load Lib "dio64_32.dll" (ByVal board As Integer, ByVal bnmFile As String, ByVal InputHint As Integer, ByVal OutputHint As Integer) As Integer

Declare Function DIO64_Close Lib "dio64_32.dll" (ByVal board As Integer) As Integer

Declare Function DIO64_In_Start Lib "dio64_32.dll" (ByVal board As Integer, ByVal ticks As Long, ByRef mask As Integer, ByVal maskLength As Integer, ByVal flags As Integer, ByVal clkControl As Integer, ByVal starttype As Integer, ByVal startsource As Integer, ByVal stopType As Integer, ByVal stopsource As Integer, ByVal AIControl As Long, ByRef scanrate As Double) As Integer

Declare Function DIO64_In_Status Lib "dio64_32.dll" (ByVal board As Integer, ByRef scansavail As Long, ByRef stat As DIO64STAT) As Integer

Declare Function DIO64_In_Read Lib "dio64_32.dll" (ByVal board As Integer, ByRef buffer As Any, ByVal scansToRead As Long, ByRef stat As DIO64STAT) As Integer

Declare Function DIO64_In_Stop Lib "dio64_32.dll" (ByVal board As Integer) As Integer

Declare Function DIO64_Out_ForceOutput Lib "dio64_32.dll" (ByVal board As Integer, buffer As Integer, mask As Long) As Integer

Declare Function DIO64_Out_GetInput Lib "dio64_32.dll" (ByVal board As Integer, ByRef buffer As Integer) As Integer

Declare Function DIO64_Out_Config Lib "dio64_32.dll" (ByVal board As Integer, ByVal ticks As Long, ByRef mask As Integer, ByVal maskLength As Integer, ByVal flags As Integer, ByVal clkControl As Integer, ByVal starttype As Integer, ByVal startsource As Integer, ByVal stopType As Integer, ByVal stopsource As Integer, ByVal AIControl As Long, ByVal reps As Integer, ByVal ntrans As Integer, ByRef scanrate As Double) As Integer

Declare Function DIO64_Out_Start Lib "dio64_32.dll" (ByVal board As Integer) As Integer

Declare Function DIO64_Out_Status Lib "dio64_32.dll" (ByVal board As Integer, ByRef scansavail As Long, ByRef stat As DIO64STAT) As Integer

Declare Function DIO64_Out_Write Lib "dio64_32.dll" (ByVal board As Integer, ByRef buffer As Integer, ByVal bufsize As Long, ByRef stat As DIO64STAT) As Integer

Declare Function DIO64_Out_Stop Lib "dio64_32.dll" (ByVal board As Integer) As Integer

The manual for the Viewpoint card gives pretty thorough instructions for the Labview souce code that also comes with the card. Using these Labview instructions, I have been able to infer what values I need to use for most of the variables in each of these functions; however, I have not been able to make sense of the "mask" and "maskLength" variables (i.e., what their purpose is, what their allowed values are, etc.) in the "DIO64_In_Start Lib" and "DIO64_Out_ForceOutput" functions. These are both functions that I need in order to be able to write my program, and the "mask" and "maskLength" variables are clearly the problem.

Of course I have no way of cracking into the "dio64_32.dll" library and seeing what it consists of. The DIO64 manual can be found here:

http://www.viewpointusa.com/DIO64%20Manual%20Ver%201_04.pdf

and the driver can be found here:

http://www.viewpointusa.com/prod_downloads.php#dio64

Thanks for your response, and again, any help would be greatly appreciated.


0 Kudos
Message 3 of 3
(3,878 Views)