The section of code is supposed to convert an integer (value) into a byte string that tells the relay board which bits to flip on and flip off at once.
PrivateSubOutputValue(value AsInteger)DimULStatAsErrorInfo'Output the value usingDOut(), converting it to UShort'Parameters:'PortNum:The output port
'DataValue:The value to be written to the port
ULStat=DaqBoard.DOut(PortNum,CUShort(value))IfULStat.Value<>ErrorInfo.ErrorCode.NoErrorsThenMessageBox.Show("Error occurred while outputting value: "&ULStat.Message,"Error",MessageBoxButtons.OK,MessageBoxIcon.Error)EndIfEndSub
This code works perfectly for the bitValues 0-7 but does nothing for bitValues 8-11 on my USB-ERB24 relay board. I believe this issue may be related to the DigitalPortType which I currently have set as AuxPort. I believe USB-ERB24 may use FIrstPortA and FirstPortB (?) The program works perfectly when I use the DBitOut() function, but I need to be able to use DOut() as well for the final program. I do not understand the DigitalPortType stuff at all. Are there any suggestions on how I should proceed to get this to work with Dout()?
Question
TFisherIRA
The section of code is supposed to convert an integer (value) into a byte string that tells the relay board which bits to flip on and flip off at once.
This code works perfectly for the bitValues 0-7 but does nothing for bitValues 8-11 on my USB-ERB24 relay board. I believe this issue may be related to the DigitalPortType which I currently have set as AuxPort. I believe USB-ERB24 may use FIrstPortA and FirstPortB (?) The program works perfectly when I use the DBitOut() function, but I need to be able to use DOut() as well for the final program. I do not understand the DigitalPortType stuff at all. Are there any suggestions on how I should proceed to get this to work with Dout()?
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now