09-11-2014 07:54 AM
I need to Integrate Cognex Dataman Wireless Handheld scanner in to existing Application.
Cognex has provided SDK in C#. Below SDK link
http://www.cognex.com/support/downloads/File.aspx?d=2628
I used CVI Tool .Net Controller to convert DLL in to instument which seems to works.
calling this .Net assemblies from Labwindows CVI. I used below link as reference.
http://zone.ni.com/reference/en-XX/help/370051T-01/cvi/libref/cvidotnet_sample_code/
Below is code that suppose to connect to cognex scanner.
/* Creates a new instance of the ethernet connector with the specified system IP address. -------------------- Prototype int Cognex_DataMan_SDK_EthSystemConnector__Create (Cognex_DataMan_SDK_EthSystemConnector *Instance_Handle, System_Net_IPAddress address, CDotNetHandle *Exception_Handle); System_Net_IPAddress IPAddress='{192.168.001.244}'; --------------------- */ Cognex_DataMan_SDK_EthSystemConnector__Create (&DM_Connector, IPAddress, 0); //Cognex_DataMan_SDK_EthSystemConnector__Create (&DM_Connector, 0, 0); Cognex_DataMan_SDK_EthSystemConnector_Set_UserName (DM_Connector,"Admin", 0); Cognex_DataMan_SDK_EthSystemConnector_Set_Password (DM_Connector, "", 0); Cognex_DataMan_SDK_DataManSystem__Create (&DM_system, DM_Connector, 0); Cognex_DataMan_SDK_DataManSystem_Connect (DM_system, 0);
My problem is below line it's not taking ipaddress.
Cognex_DataMan_SDK_EthSystemConnector__Create (&DM_Connector, IPAddress, 0);
I have attached source code for LabWindows and sample application for C# which is working
Please advise , I have no sucess so far with this
09-11-2014 08:59 AM
How are you getting handling Cognex_DataMan_SDK_EthSystemConnector *Instance_Handle?
What you are you obtaining the Instance_Handle?
09-11-2014 09:41 AM
Cognex_DataMan_SDK_ISystemConnector DM_Connector; Cognex_DataMan_SDK_DataManSystem DM_system; System_Net_IPAddress IPAddress="192.168.001.244";
It's define as gloabl.
09-11-2014 02:16 PM
@aspireaccer wrote:
Cognex_DataMan_SDK_ISystemConnector DM_Connector; Cognex_DataMan_SDK_DataManSystem DM_system; System_Net_IPAddress IPAddress="192.168.001.244";
It's define as gloabl.
Yes, but it needs to be initialized with a value.
How are you going about obtaining a value for it?
I don't want to install the SDK on my work laptop, but if you could attach the C# .cs file, it may be useful.
09-11-2014 06:55 PM
Thank you so much for your time.
I have attached SDK documentation and also I have attached zip file of C# source code.
From Manual instructions.
Connect to your Ethernet device by performing the following steps:
1. Create a connector to your device:
EthSystemConnector myConn = new EthSystemConnector(deviceIP);
where deviceIp is either a known IP address or one that was discovered by an EthSystemDiscoverer.
2. Specify user name and password:
myConn.UserName = "admin"; myConn.Password = "password or empty string";
3. Create a new DataManSystem instance with the created connector:
DataManSystem mySystem = new DataManSystem(myConn);
4. Call the Connect() method of your DataManSystem instance:
mySystem.Connect();
5. (Optional) Verify if you are connected:
if (mySystem.IsConnected)
6. To disconnect, call
mySystem.Disconnect();
09-11-2014 08:28 PM
I think I found problem but I still need to try and verify
I'm missing following. I need to do following convertion.
System.Net.IPAddress ipaddress = System.Net.IPAddress.Parse("192.168.1.244");
09-12-2014 07:55 AM - edited 09-12-2014 08:09 AM
What is YOUR code that you have written?
Edit: 192.168.1.244 string is being converted to Integer64 in that code snippet you posted.
06-05-2018 01:30 AM
hi
my prject is the same as u but with labview
i found a problem in connecting to the divice
please help
thx
06-05-2018 04:46 PM
Since this forum post is 4 years old and not related to LabVIEW, I would recommend starting a new thread with details about your specific issue so it can gain more visibility. I suggest including the details listed below:
1. What specific problem do you have connecting to the device?
2. What specific device are you using?
3. Have you installed the device drivers from IDNet?
4. How are you physically connecting to the device and does your computer recognize the instrument?