Reading from serial and ethernet objects simultaneously (2 HW connections)

1 view (last 30 days)
I'm doing a test where I connect to two instruments. The first is a sensor which uses TCP/IP ethernet and the second is an Autobox which uses serial communication. I only want to read data from the instruments. When I only create the tcpip object and connect, everything works as it should. Also when I only try the serial communication, it seems fine. In other words, the communications are working so that's not the problem. But, when I put the objects in the same program (which they have to be), I get an error. The program basically:
1. Creates and opens the tcpip object to the sensor. (initial phase of script) 2. Creates and opens the serial object to the Autobox. (initial phase of script) 3. Reads from the tcpip object. (in the main loop) 4. Reads from the serial object (in the main loop) 5. Uses the data from the tcpip object. (this is where the error occurs)
Is there something basic I've forgotten? I get the error by only creating the serial object as well (i.e. not reading anything from it).

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!