Hi,
How would application knows the edge device is assigned to station?
is it possible to get the current state of an edge device and show it in Tulip?
We’re using several edge devices for our Zebra printers, and I like to know if a device is unreachable (and so the printer too) and to inform the user.
I want to show an error of some sort while an app is running if a Zebra printer (connected via Edge device) is offline/unreachable.
From the shop floor view, you can see which edge devices are assigned to a station, and a user with the appropriate access role can add or remove edge devices. When the user runs the App, the system will be able to access edge devices assigned to the station where the user runs the app. Note that you will need to configure the app to specifically select the edge device associated with the active station.
I want to show an error of some sort while an app is running if a Zebra printer (connected via Edge device) is offline/unreachable.
One solution for high visibility on this issue would be to create a Machine object in Tulip to correspond to your edge devices for using that printer. Using a Node-RED flow, you can send a heartbeat at regular intervals to a machine attribute endpoint (E.g., every 5 seconds). In Tulip, you can have this machine object check if it has received a heartbeat in the last 30 seconds, and determine whether the system is stopped or running based on that.
Your app can then show errors based on the machine state, and embed a live view of the machine state as well so it is very obvious if your edge device is online or offline before a user prints.
Your best option would be to set up a small Node-RED flow to create a heartbeat. To do this, you can follow these steps
Enable Node-RED on the edge device, if it is not enabled already
Set up a machine type for your edge device. Include or create an attribute for heartbeat. Assign it the datetime variable type
In that same machine type, create a machine trigger to check every 30 seconds (most frequent scan time currently) to see when the last heartbeat was sent. It will set the machine to stopped if the last heartbeat was outside of the expected time range. Make sure you create another trigger to wake up the machine when it next receives a heartbeat
In your edge device, add a flow like the following. This injects the current date time every 1 second, to the Heartbeat machine attribute endpoint for the machine associated with the edge device. You can choose a less frequent injection rate, if you’d like. You’ll need to make sure to press the button on the injection node to start the counter. For the machine attribute, you’ll want to review the knowledge base article on using machine tags.
Go to your machine in tulip, create a machine for the edge device machine type we made earlier. In the configuration menu, go to your edge device, then the heartbeat attribute. Make sure you see the machine go to the running state. If you unplug your edge device or disable the flow, it should go to the stopped state within typically 20-30 seconds.
Now in your app, you can execute logic based on these parameters.
I know what you’re looking for is a simpler solution of just “if the edge device is down, I can stop the operator”, but as far as I’m aware edge devices are not an independent event generator in Tulip. But machines are event generators, and readily integrate with edge devices, so I believe this is your best option.
.
No I just explained it wrong. I realized last night that there is no datetime type for machines. I’m not sure where that came from in my explanation. I’d recommend using Boolean instead.
.
.
.
mh, I think there is something wrong in my node_RED flow:
Error: Response status code 422
I copied the machineId and attributeId from the machine type attributes in the flow, which should run on the corresponding edge device, but I can’t get it connected to, as shown in your example.
But I’m an absolte beginner in this and have no helping hand in my company :-/
No worries, I realized a while ago that the reason this stuff can get confusing is that a lot of it has only really been doable for maybe ~10 years at most. You’re doing something very new in the industry.
Basically, instead of using the machine attribute node to send data continuously to a machine attribute, you will be setting up your edge device as a data source, then assigning that data source to your machine. You do this by creating a tag list on your edge device, then selecting the tag in your tulip-tag node.