dll help for electronic card c# 2005
Ive been trying to program using the dll that is supplied with a USB Relay card.
The source code supplied was in VB 5 or 6 , not that I know that matters, doesnt mean the dll was written in that or that it matters ??
Anyway the error I get is 'the best overloaded method match for OCUSB.classOCUSB.RelayON(ref byte, ref byte) has some invalid arguments
Code:
C# 2005
classOCUSB myUSB = new classOCUSB();
bool myBool = true;
byte a = 0;
byte b = 1;
myBool = myUSB.RelayOn(0, 1);
mybool = myUSB.RelayOn(a, b);
myBool = myUSB.SetPWM(0, 127);
Any ideas what is wrong ?
'-------------------------------------------------------------------
'Function: RelayOn(Address As Byte, Number As Byte) As Boolean
' Turns off a relay specified by Number
' For the unit defined by Address
'Inputs: Number - The number of the Relay to turn on
' 1-8 = Relays 1-8
' 0 = All Relays OFF
'Returns: True = Success
' False = Timed out
'-------------------------------------------------------------------
Re: dll help for electronic card
i had to include 'ref' as in relayOn(ref a, ref b); :blush:
however I am having a problem in importing another dll. If you can help , it is inpout32.dll from http://www.logix4u.net/ ->
dll -- will not add to project error ?
I have tried to add reference to either 32 or 64 bit dll. I have tried creating the dll from the source. I keep getting error when I try to add reference,
PHP Code:
'make sure the file is accessible and that it is a valid assembly or COM component etc etc '
I am using vs 2005 c#
what do i need to do please ?
Exactly same problem with the io.dll from link below. If anyone can have a look .
http://www.oceancontrols.com.au/cont...relay_k074.htm
Re: dll help for electronic card c# 2005
You don't need to do that. Just use standard API syntax to declare the functions form the DLL.
Re: dll help for electronic card c# 2005
thanks, it is successful.