11-28-2012 06:29 PM
Hi I am a newbie and I am working on to communcate to a MDB. The Communication Format is as follow:
Baud Rate: 9600 NRZ
Serial Bit Format: 1 Start Bit
8 Data Bits
1 Mode Bit
1 Stop Bit
This is how to send data and read data from the MDB:
00001xxxB (08H) Changer
Mode Address Command
Coin changer reset 0x108 1 00001 000
Coin changer setup 0x109 1 00001 001
Coin changer tube status 0x10A 1 00001 010
I read on NI web site to use the parity Mark to set the mode bit. When I try to read data from the MDB I get a framing error (0xBFFF006B). I also read in another forum to test the Mark using the Measurement and Automation explorer. I try it and still get the error. I am a bit lost on how to communicate to the MDB. I try differrent setup but nothing works. I hope someone could help me on this.
Thanks
JJ
11-29-2012 01:57 AM
Hi,
For some modules we have I also have to use an extra bit (9th bit) for the communication.
Sending data you change the parity to mark and space to add a 9th bit. But when you receive the same data (with either mark or space parity) you get a parity error (not a framing error).
You should catch this error and delete it.
I use this to communicate with modules in a test set-up.
Kees
11-29-2012 06:39 AM
Usually, a framing error is a baud rate issue. Double check all of your serial settings and verify that the device is using the same.
11-30-2012 07:42 AM
I know my baud rate is set right but I will double check it. The unit I am working with will poll device on the bus. I am looking for when it polls b 1 01100 000 for the address of the slave at this address. I have a couple of Idea on how to capture the data.
Thanks
JJ
11-30-2012 08:13 AM
I do have another question that might resolve the Framing error. When the MDB poll all the device on the bus. How can I use the mark parity with the 0x60 data to be accepted by LabView when it see it on the Bus and not any othe address it may see. I am new at this and in the past I have written programs on a microchip to work with Labview via RS232 but this application is new to me because of using the Parity bit as a mode bit for the address. I know how to use a Pic chip to communicate to the device but I would like to use LabView as well.
Thanks
JJ
11-30-2012 09:16 AM
Hi,
You described the data with the Mode bit. Does this apply for both sides ?
If so you will always get a framing error on the received data. I use the same kind of communication (based on the old Intel 9 bit protocol)
Kees
11-30-2012 02:35 PM
Hi the MDB sends out the code with the mode bit with the address to the device. The device will reply back with the mark bit and an ack code to let the MDB know it is on the bus. Then the MDB will send addition code that could be up to 32 bytes to the device. I can write a code for the Microsoft Pic chip to and to talk to the MDB by using the parity Mark bit. I just having trouble using LabVIEW to talk to the MDB.
11-30-2012 02:43 PM - edited 11-30-2012 02:43 PM
Ok, This way you can change the parity After sending x byte(s) before sending the next byte(s)
Let me know if you understand this.
Maybe you also post your VI you have.
Kees
11-30-2012 03:12 PM - edited 11-30-2012 03:13 PM
I think that was my problem I was not setting the Mark back to space to read the data when the MDB sends data to Labview. I will give that a try tonight.
Thanks
JJ
04-22-2014 08:06 AM