I am trying to use a CAN adapter that has a built-in FTDI chip running the serial port at 3,000,000 Bauds.
That is a weird Baud rate but apparently, the FTDI chip supports it. The CAN adapter came with a piece of software to apparently "enable" the 3,000,000 Baud rate in the driver.
When I open the port in putty and set the Baud Rate to 3000000, it decodes the messages just fine.
When I try to do the same thing in B4J (using the Oracle JDK), setting the Baud Rate to 3000000, I get garbage characters. It looks as if the Baud rate was wrong.
Interestingly, in order to receive anything, the CAN adapter has to be enabled, and that's done through serial commands, so since I get stuff from the adapter, it has to receive the "open" command. Therefore it would appear the transmission (from the PC to the device) actually occurs at the specified baud rate but the reception (device to PC) is corrupted or at the wrong rate.
The SetParms method of the SerialPort object takes an Int as a parameter, so I am not even sure how that could possibly work, but I get no error when feeding it a parameter of 3000000...
An alternative would be to use a dll they provide and which I tested under VB 6.0. It alleviates the problem because the dll communicates with the COM port "directly".
I am not sure if I can use a dll from B4J.
Looks like it's going to be a long road...
That is a weird Baud rate but apparently, the FTDI chip supports it. The CAN adapter came with a piece of software to apparently "enable" the 3,000,000 Baud rate in the driver.
When I open the port in putty and set the Baud Rate to 3000000, it decodes the messages just fine.
When I try to do the same thing in B4J (using the Oracle JDK), setting the Baud Rate to 3000000, I get garbage characters. It looks as if the Baud rate was wrong.
Interestingly, in order to receive anything, the CAN adapter has to be enabled, and that's done through serial commands, so since I get stuff from the adapter, it has to receive the "open" command. Therefore it would appear the transmission (from the PC to the device) actually occurs at the specified baud rate but the reception (device to PC) is corrupted or at the wrong rate.
The SetParms method of the SerialPort object takes an Int as a parameter, so I am not even sure how that could possibly work, but I get no error when feeding it a parameter of 3000000...
An alternative would be to use a dll they provide and which I tested under VB 6.0. It alleviates the problem because the dll communicates with the COM port "directly".
I am not sure if I can use a dll from B4J.
Looks like it's going to be a long road...