ss2
ss2

Reputation: 113

How to constantly listen for data from serial port in Ignition

I am developing a program to be constantly listening for data on ignition, and when they send the information, I would add the value to a tag or some property. And the serial data may be sent multiple times. So I have to wait till the window is closed, to stop that process.

I thought of trying to have a background asynchronous thread to loop or waiting for interrupts in the background constantly, but that doesn't seem to be feasible with the way ignition is structured (to my understanding, I learned ignition 2 weeks ago).

I tried taking a look at system.serial. But I don't see any way to constantly listen for data.

If anyone has any idea on how I would implement this?

Upvotes: 1

Views: 443

Answers (1)

user21067989
user21067989

Reputation: 1

Look into adding a TCP device in the OPC server. You will be able put the IP and port of the device.

With this device, you can add an OPC tag into your tags. You can then put in a change script to do an action every time the tag changes, which will change with data is detected on that device.

Upvotes: 0

Related Questions