|
-
Jun 28th, 2007, 06:33 AM
#1
Thread Starter
Lively Member
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
'-------------------------------------------------------------------
Last edited by mikelynch; Jun 29th, 2007 at 05:42 AM.
-
Jun 28th, 2007, 08:26 AM
#2
Thread Starter
Lively Member
Re: dll help for electronic card
i had to include 'ref' as in relayOn(ref a, ref b);
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
Last edited by mikelynch; Jun 29th, 2007 at 05:52 AM.
-
Jul 2nd, 2007, 06:25 AM
#3
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.
-
Jul 2nd, 2007, 07:08 AM
#4
Thread Starter
Lively Member
Re: dll help for electronic card c# 2005
thanks, it is successful.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|