04-03-2007 08:21 AM
04-03-2007 08:40 AM - edited 04-03-2007 08:40 AM
There is a visa close right next to the visa read function in the serial pallet
Message Edited by James R on 04-03-2007 08:41 AM
04-03-2007 08:56 AM - edited 04-03-2007 08:56 AM
Message Edited by Dennis Knutson on 04-03-2007 07:58 AM
04-03-2007 08:57 AM
04-04-2007 03:44 AM
First of all, thank you for your replies.
I understand that I have two choices : try to write from the pc to the device thanks to visa write.vi or implement the dll. In the first case, it seems to be difficult because I don’t know how to write to the device. I have a protocol but it is not really clear. (see attached file)
I find an example that use the dll in C# so perhaps it will be the easiest way to proceed. The problem is that I’m not sure if Labview can do what I want.
The program proceed like that :
class IOptimusMini
{
const string DRIVER="OptimusMini.dll";
public const int SCREEN_SIZE=96;
public const int SCREEN_BUFFER_SIZE=SCREEN_SIZE*SCREEN_SIZE*3;
public delegate void OnKeyDownCallbackDelegate(int key);
public delegate void OnDeviceStateChangedCallbackDelegate(int state);
[DllImport(DRIVER)]
public static extern int RegisterEventHandler(OnKeyDownCallbackDelegate dk, OnDeviceStateChangedCallbackDelegate ds);
}
...
04-04-2007 03:44 AM
...
class UsageExample
{
static void OnKeyDownCallbackHandler(int key)
{
Console.Write("Keydown {0}\n", key);
}
static void OnDeviceStateChangedCallbackHandler(int state)
{
Console.Write( state > 0 ? "Connected.\n" : "Disconnected.\n");
}
static void Main( string[] args )
{
byte[] img = new byte[IOptimusMini.SCREEN_BUFFER_SIZE];
/* register callback handlers if you want to process keypresses */
IOptimusMini.RegisterEventHandler(
new IOptimusMini.OnKeyDownCallbackDelegate( OnKeyDownCallbackHandler ),
new IOptimusMini.OnDeviceStateChangedCallbackDelegate( OnDeviceStateChangedCallbackHandler )
);
}
I have access to the function RegisterEventHandler thanks to my dll but the input parameter are functions (with in addition a delegate class which is not accessible from Labview 7.0).
So I would like to know if it is possible to have a CIN block which has as outputs the functions I need in input of my dll.
Thank you in advance.
04-04-2007 08:53 AM
04-04-2007 09:18 AM
04-05-2007 03:37 AM