Ok, the two program uses the same IO channel but not the same IO port (I write to DIO0 and I read on DIO4).
The labview program seems to get the control of the entire Digital port channel also if I use the singlebit digital write block.
The program below is the one used for Vb control of NI board.
This program set in the 6601 board the digital line 4 as output and force line 4 to high level for same seconds set by Txtduration.
Private t As Long
Option Explicit
Private Sub BtnQuit_Click()
Unload DigitalOut
End Sub
Private Sub Form_Load()
Dim Result
Dim iStatus As Integer
Dim iRetVal As Integer
Dim iDevice As Integer
Dim iPort As Integer
Dim iLine As Integer
Dim iDir As Integer
Dim iStateON As Integer
Dim iStateOFF As Integer
Dim iIgnoreWarning As Integer
iDevice% = 1
iDir% = 1
iStateON% = 1
iLine% = 4
iStatus% = DIG_Line_Config(iDevice%, iPort%, iLine%, iDir%)
If (iStatus% < 0) Then
MsgBox "Whoops ! There is a problem with DIG_Line_Config." + Str(iStatus%), vbOKOnly + vbCritical, "Ciao"
Unload DigitalOut
End If
End Sub
Private Sub Frame2_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub Impulse_Click()
Dim Result As Boolean
Dim iStatus As Integer
Dim iRetVal As Integer
Dim iDevice As Integer
Dim iPort As Integer
Dim iLine As Integer
Dim iDir As Integer
Dim iStateON As Integer
Dim iStateOFF As Integer
Dim iIgnoreWarning As Integer
iDevice% = 1
iDir% = 1
iStateON% = 1
iLine% = 4
t = 0
Timer1.Enabled = True
iStatus% = DIG_Out_Line(iDevice%, iPort%, iLine%, 1)
Do
If t >= Val(TxtDuration) Then Exit Do
DoEvents
Loop
Timer1.Enabled = False
t = 0
iStatus% = DIG_Out_Line(iDevice%, iPort%, iLine%, 0)
If (iStatus% < 0) Then
MsgBox "Whoops ! There is a problem with DIG_Line_Config." + Str(iStatus%), vbOKOnly + vbCritical, "Ciao"
Unload DigitalOut
End If
End Sub
Private Sub Timer1_Timer()
t = t + 1
End Sub
If I use the MAX testpanel during the labview program i have this error
-10612 badLineDirError The specified line does not support the specified
transfer direction.
Instead if I use the VB program during the execution of the labview VI i have the following one:
-10602 noWriteError No output data has been written into the transfer buffer.
Do you have any idea to solve the problem?