What's the bare minimum code to read data from a serial port?
Edit for answer: STREAMIN is the only block required.
Setting up the port and checking the hardware layer is best done outside the ladder logic.
---
I've looked at the example IntSerial server port code, and it seems like complete overkill for what I want to do.
The plan is to read from a Honeywell linear sensor that puts out data at "RS-232-type digital" at 57.6kbits/s (The
SPS-L225-HDLS ). That is the sum total of all information I have on the sensor's communication and setup. The datasheets and specs don't tell me the part, bits, stop, etc. ¯\_(ツ)_/¯
The sensor has a 6-24V input, ground, and output. I've got 12V and ground hooked to the same PLC power, with additional ground pigtail to the IntSerial GND. The output wire is attached to the IntSerial RX/D- pin. Nothing is attached to the TX/D+ pin.
BRX is a
BX-DM1-19ED2-D All I'm looking for is simple code that reads in the info from the sensor. If I could get bad information, like if it's the wrong parity or whatever, I can use trial and error to find the right settings. All I'm getting is errors though, either with the sample code or with a couple of rungs that I've been trying. (SETUPSER, OPENDEV, DEVREAD, STREAMIN) and it feels like I'm just missing one step somewhere.
I can't find anything in the online documentation, the forums here or at AD, and I'm stuck. If there was even a way to read the error codes (instead of "Failure Detected") that would also be helpful.