I don't really know what you are trying to do or what you mean exactly by send this code by Modbus but I'm afraid what the library (minimalModbus) is doing is exactly what it is supposed to. The library will build the following Modbus frame: 01 10 0000 00014 0058 9ABE In CoolTerm, select Send String from the Connection menu and click on the Hex. When you have a hard-wired and the serial port settings match, framing errors are usually caused by bad cables or noise on the line. This is a frame that the radio generates so you will read these but will. In your case you indicated that you have a Bluetooth USB dongle. I would highly suspect that its simply not capable of running at that speed. This is what each value on this frame means:Ġ1: The Slave Address (default is address 1)ġ0: The Function Code 16 (Write Multiple Holding Registers, 16 = 10 hex)Ġ000: The address of the first register (0000 hex = 0, +40001 offset = register #40001).Ġ003: Number of registers to write since you are giving a 3-element listĠ6: Number of data bytes that follow (3 registers x 2 bytes each = 6 bytes).ĩABE: The CRC (Cyclic Redundancy Check) for error checking. ![]() Open up CoolTerm or a similar program and you can connect to your board at. The sequence 01 00 14 00 58 is not a valid Modbus frame because there is no function code 00(only values from 1 to 6, 15, and 16 are allowed). ![]() RX packets:1843 errors:0 dropped:1 overruns:0 frame:0 TX packets:83 errors:0. So something at like an OS level is hanging up on this somehow.īTW: Coolterm is a quite nice terminal emulator.Maybe what you want is just to send that sequence over the serial port? Otherwise, you should think about where those values are coming from. The only way out of this is to drop the connection entirely and start over. attempt to send data with coolterm (nothing out, shows some sort of “working icon”).No errors on the Xojo end BUT nothing going out the serial port and nothing coming back either ![]() bring up both coolterm and Xojo Project so both running and disconnected from any port.Modifications are to add a button that writes to the serial port a line and removes the if statements from serial port data available so that it logs everything coming back Xojo project to test with is a slightly modified version of the example program for communications with a barcode reader. No, the thing does get an error if there is something else with the port open. Xojo should be able to do it too but it (and I) must be missing something in the connection. Do not worry for me in this respect I shall sacrifice sleep if I must to finish on time. I accidentally broke the Bluetooth module today trying to factory reset it, so will have to order a new one, thus stalling the project for up to 50 of the remaining time until the due date. There is NO data coming into DataAvailable at all (never fires).įWIW: I get this same behaviour with VS2017 VB.NET and I thought I check this with something simpler than that.Īnyone got any ideas on what this could possibly be? This isn’t hard. I have an Arduino Pro Mini connected to a FTDI SmartBasic connected to a Bluetooth Mate Silver. I connect to COM9 (9600,8,N,1 no flow) with no errors given Using the serial port example in Xojo 2018R4 that is looking for CRLF lines coming back from a barcode reader and putting them on the screen (sorry, wasn’t paying enough attention when I opened it as to what the name of it was, but it was under the communications dropdown of examples): I see all this traffic with TeraTerm without problems. The device is spitting out a couple of bytes with a CRLF at the end of it 2/second so this isn’t exactly fast or rocket science stuff. If I open it with TeraTerm, 9600,8,N,1 no flow control, I get bidirectional communications without problems. I’ve got a USB device that is presenting a virtual serial port on my windows machine.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |