Hi, I’m a bit new to the usage of OPC UA to communicate with other devices, I’m trying to communicate a X20CP1684 PLC to a Keyence IV4 camera using OPC UA, in this case the camera is the OPC UA Server.
Currently I’m able to read primitive data types and execute methods using EasyUaClnt but the data I’m interested in is inside a custom data type, for testing I’m trying to read a more simple data type MachineInformation I’ve created a Structured Type inside Automation Studio with specifications given by Keyence.
But the actual information I want is inside a nested custom data type but before I try reading that I’m trying to read a more simple data type, somewhere I’ve read that I need a .nodeset file but I don’t know how to get it.
The Keyence camera exposes the types inside a folder called Types in its OPC UA server
Information, PLC X20CP1684 AS 6.5.3.11, Server is a Keyence IV4
Hi @Jose_Veliz ,
Have you tried first to connect Keyence camera with OPC UA client freeware tool UaExpert?
I never used Keyence because we have our vision system but you can found these steps:
To connect a Keyence IV4 vision sensor to Unified Automation’s UaExpert, you must enable the built-in OPC UA server function on the IV4 via Keyence software and then target its unique endpoint URL from UaExpert.
Step 1: Configure the Keyence IV4 Sensor
Before using UaExpert, you must enable the OPC UA server and assign an IP address to the sensor.
Open Keyence IV Smart Navigator software.
Click Sensor Setup and connect to your IV4 sensor.
Go to Sensor Advanced → Utility tab.
Select FieldNet/Comm. Unit (DL) or Network Settings (depending on your firmware version).
Locate the communication protocol options and change the selection to OPC UA.
Set a Static IP address for the IV4 and note it down. Disable DHCP to ensure the IP does not change.
Take note of the Port Number designated for OPC UA (the default is usually 4840).
Click OK to transfer the settings. The IV4 sensor will automatically restart to apply the configuration.
Step 2: Establish the Connection in UaExpert
Open the UaExpert client on your computer.
Right-click on the Servers folder in the Project view panel and click Add….
Expand the Advanced tab in the pop-up window.
In the Endpoint URL field, type the address utilizing this syntax: opc.tcp://<IV4_IP_Address>:<Port> (Example: opc.tcp://192.168.0.10:4840)
Choose your preferred Security Policy (start with None or Sign & Encrypt based on your company’s network security requirements).
Click OK to register the server.
Right-click the newly added Keyence server in your list and select Connect.
Step 3: Browse and Monitor IV4 Data Tags
Locate Variables: Once connected, expand the IV4 server tree inside the Address Space window. Navigate down into the objects folder to locate the sensor’s live data fields.
View Results: Drag and drop live items (like Tool_1_Matching_Rate, total OK/NG counts, or trigger bits) directly into the Data Access View window to watch the data update in real time.
======================
As second step theoretically you can communicate with your camera without a line a code, Third-party systems
Hi, thank you for your answer sorry not clarifying this but I’ve already used UaExpert I used it for most of the development to get the NodeId and the structure the problem is that the variables I want to read from the Keyence camera doesn’t have individual NodeId and as far as I know OpcUa_any doesn’t support custom data types.
This is the structure, the data I want is OKCount, NGCount, etc. those variables don’t have individual NodeId but those variables are part of the ResultStandard data type which is part of the OperationResult data type and I only have NodeId for OperationResult
For the Identification He didn’t select the Default setting “NodeId” but “BrowsePath”, more details in the Help: Relative path names.
In your case I think you can configure 13 Channels with basic data type:
BOOL/USINT/SINT/UINT/INT/UDINT/DINT/REAL
Those numbers you see on the left side of each variable are the NamespaceIndex (ns) and as I said I don’t have those for the variables I want to read. I could try using the same ns I have for OperationResult but I don’t think that’s how it works
I have new information, I got the Machine Information variable to connect to the server and get the data, the thing is that I didn’t do anything different just turned on my pc try it and it worked even without the uanodeset file, so I made the data type in AS for the Operation Result (nested complex data type variable) information as specified in the manufacturer’s pdf but this variable doesn’t communicate with the server. I even modified the variable that worked (Machine Information) to see if it still works even if the data type doesn’t match the specification and it works the data is not correct but I get something, but with the Operation Result data I don’t get anything not even wrong data, so I don’t know exactly what’s happening.
Does anyone who has done something similar what is the correct way to do it maybe I’m missing a step, thanks
Basically my question was, what’s the way to communicate with a custom OPC UA, specifically I asked if creating a Data Type in Automation Studio was the only thing I had to do. The basic answer is yes for anyone who wants to do that, that’s it create a Data Type that matches the Data Type on the OPC UA server it will work, in my case I followed the Camera’s PDF specification and it didn’t work, but after modifying the Data Type in AS it is half working at least I can get the data I want still I haven’t had enough time to figured out where exactly is the mismatch but that’s the answer.