Serial (Looped) Connection of Serial Devices

I have a Tulip Table that contains Serial Device connection parameters for various ancillary devices used with my Torque Testing app.

On my Device Connections - Loop Initiate Step, I have a trigger to grab the list of serial numbers for all connected devices:

I also have a trigger to effectively filter this list against my list of known ancillary devices from my Tulip Table:

Which leverages this query:

…and this aggregation:

Which effectively provides the truncated list of KNOWN devices available for connection:

My step loop logic will iterate through this abbreviated list, making the device connection per the COM Port identified in the connections object list and the connection parameters specified in the Tulip Table.

7 Likes

Hey Jim,

Thanks for sharing this with Tulip Community :slight_smile: This is a neat way to dynamically connect to your hardware from a Tulip app, love it!

Clever use of MAP_TO_TEXT_LIST @jmlowden :nerd_face:

It is great to see you continuing to do cool things using Tulip! Thanks for sharing!

1 Like

I’ve run into a potential snag - the triggers within the app currently “communicate” with these devices by Static Value | Text “Identifier” parameters in the Run Device Function and Device Output triggers:

These values currently coincide with table data, but if the table data changes I wouldn’t want ot have to update my app accordingly.

I’m thinking I need to make this dynamic based on the device type connected…and maybe just leverage the first device of a type (i.e. Serial Barcode Scanner, Printer) as the default input/output and let the user know that if they prefer to use the second device instead, to disconnect the first of the device type and re-run the connection steps.

Thoughts?

My first attempt at a solve:

…which didn’t work because the ARRAY_INDEX_OF function seems to need an exact match, not just a “contains” type match.

This worked - basically storing whatever is the last connected Identifier containing “Printer” or “Scanner” (reminded me that Contains is case sensitive in this context, unlike table filters):