Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: EDurako on August 09, 2018, 12:44:50 PM

Title: BRX ASCII out via RS-232
Post by: EDurako on August 09, 2018, 12:44:50 PM
I recently posted trying to get hex out of the RS485 port. Thanks everyone for the help, I got it to work but the printer needed to print 1 extra label for changes in the message to take effect. So enter printer number 2!

I think this is going to be more simple, but I am puzzled by the BRX (BX-DM1E-M-D) behavior.

When set to RS485 the TX and RX lights on the internal serial port energize according to the logic.
When set to RS232 the TX and RX lights on the internal serial port stay dark.

I am just trying to send a Status Query to the printer. I have verified that the baud rate is set correctly and I am sending data from a VDC device to a VDC device, both connected to the same 0VDC terminal on the 24VDC power supply.

The print to string scrip I am running is "$1b$53$2a" which is what I translated <ESC>S* from the printer manual. Insert spaces in UN-checked for the print string command.

I am expecting the printer to return a 0 for OK, via STREAMIN but nothing is happening.

I think I have the RS232 port setup wrong or maybe I'm using the wrong commands since the TX and RX lights are dark?
Title: Re: BRX ASCII out via RS-232
Post by: BobO on August 09, 2018, 12:55:00 PM
Whether the port is in RS232 or RS485 mode shouldn't affect the TX LED coming on. Not sure what could be going wrong.
Title: Re: BRX ASCII out via RS-232
Post by: BobO on August 09, 2018, 12:56:24 PM
I bet the device is blocked on a STREAMIN call...
Title: Re: BRX ASCII out via RS-232
Post by: EDurako on August 09, 2018, 01:10:44 PM
Problem solved. It was the ground, the company that supplies these toys keeps incorrectly making the connector cables!!!

Also, the TX and RX lights now work!

Much love to those who took the time to read and reply!
Title: Re: BRX ASCII out via RS-232
Post by: BobO on August 09, 2018, 01:21:00 PM
Problem solved. It was the ground, the company that supplies these toys keeps incorrectly making the connector cables!!!

Also, the TX and RX lights now work!

Much love to those who took the time to read and reply!

Great!

Just a programming note: You have a length and delimiter set to terminate the STREAMIN, but no timeout. If you don't get the expected data, that will hang. If you know what the expected length is, you can wait until IntSerial.InQueue shows the expected bytes prior to calling STREAMIN, but if you don't know, you really need to use a timeout.