Industrial Communications

cancel
Showing results for 
Search instead for 
Did you mean: 

Omron PLC - Ethernet/IP Communication

I need a data communication between Omron PLC and Labview. According to my researches, we must specify the eds file of Labview to Omron PLC. Someone mentioned to use Generic EDS file for communicating with Labview. We tried this method but it couldn't work. Then i tried these instructions.Finally, i try to generate EDS file via EZ-EDS program. Unfortunately, i haven't accomplished any solution. Can you help me?

0 Kudos
Message 1 of 6
(5,168 Views)

Try converting the Omron dlls:  CIPCompolet.dll, CIPCoreDotNet.dll, - 14 dlls in total to .net controller
as done here
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000kJLKSA2&l=en-US

Then just use the .fp files created.

0 Kudos
Message 2 of 6
(4,902 Views)

I was able to make Omron (CJ2) with LabVIEW over EIP using my EDS file ( attached here ). Make sure to modify MajorRev attribute to your EIP driver version. For example, if you have EIP Drivers version 2018, then use MajorRev 18, else use 17.

 

Let me know if you run into issues.

 

Vijay

0 Kudos
Message 3 of 6
(4,746 Views)


I used an OPC client "https://www.kepware.com/en-us/products/kepserverex/suites/omron-suite/" or NI has an OPC client/server you could also use.

And the Network Variable Library (The NI Variable Engine Must be running via Task Manager ) functions:


SetWaitCursor(1); 
 
status = CNVCreateSubscriber ("\\\\computer name \\PLC Tag library\\OP2000_BCR_DONE", DataCallback, StatusCallback, 0, 10000, 0, &scub);

SetWaitCursor(0);

status = CNVCreateReader ("\\\\computer name\\PLC Tag library\\OP2000_BCR_DONE", StatusCallback, 0, 5000, 0, &newhand);
  
Delay(0.2);

CNVDispose (scub);


///----------------------------------------------------------------------------
/// HIFN Network Variable Data Callback - called whenever the data is updated.
/// HIFN NOTE: This callback is called on a worker thread and not the main thread.
/// HIPAR handle/Handle of the Network Variable connection
/// HIPAR data/Handle of the new Network Variable data
/// HIPAR callbackData/User specified callback data
///----------------------------------------------------------------------------
static void CVICALLBACK DataCallback (void * handle, CNVData data,
  void * callbackData)
{
 unsigned int nDims;
 CNVDataType  type;
    char *mydata = malloc(30);
 
int status = FAILURE;

CNVGetDataType (data, &type, &nDims); //mydata   machine_msg
 
status = CNVGetScalarDataValue (data, CNVString, &mydata);
 
sprintf(machine_msg,"%s", mydata);

CNVDisposeData (data);
}

///----------------------------------------------------------------------------
/// HIFN Network Variable Status Callback called whenever connection status changes.
/// HIFN NOTE: This callback is called on a worker thread and not the main thread.
/// HIPAR handle/Handle of the Network Variable connection
/// HIPAR status/The new status of the Network Variable connection
/// HIPAR error/The error, if any, in the Network Variable connection
/// HIPAR callbackData/User specified callback data
///----------------------------------------------------------------------------
static void CVICALLBACK StatusCallback (void * handle,
  CNVConnectionStatus status, int error, void * callbackData)
{
 if (error < 0)
 {
   puts("\nERROR...");      
 }
 else
 {  
  switch (status)
  {
   case CNVConnecting:
    
 
      puts("\nConnecting...");

    break;
   case CNVConnected:
    
       puts("\nConnected");
      
    break;
   case CNVDisconnected:
     puts("\nDisconnected!!!");    
    break;
  }
 
 }
}

0 Kudos
Message 4 of 6
(4,736 Views)

Hello Vijay can you share the VI and how you used the EDS file

0 Kudos
Message 5 of 6
(1,390 Views)

I would also like to know. It seems that he used the EIP toolkit to develop the VIs.

The example project shipped with LabVIEW just like this.

NI Example.png

However, none of these VIs demostrate how to do the communication with EDS file.

Should we import the LabVIEW EDS to Omron's Network Configurator software?

0 Kudos
Message 6 of 6
(1,083 Views)