LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Serial loopback test with RN-41 BT module not working

Hi

 

I'm able to do a loopback test with hyperterminal using a RN-41 bluetooth module and communicate with the mcu the BT module is connected to.

 

 

I'm also able to do a loop back test with a serial cable using the Labview basic serial read/write example.

 

But when I try and use the basic read/write example I can't get the loopback test to work if I short the TX/RX pins on the BT module (but this does work in hyperterminal), I'm puzzled, any ideas much appreciated.

0 Kudos
Message 1 of 8
(4,774 Views)

Hi icecoldies,

 

Thank you for your post to the forums.

 

I would like to find out some more information from you regarding this issue:

 

When you mention you have a RN-41 bluetooth module that is communicating with the MCU that the BT module is connected to. What MCU do you have and what BT module exactly?

 

When you mention you have shorted the TX/RX pins on the BT module, which pins exactly? Would you be able to explain this section in more detail? Perhaps provide some images?

 

Have you made any changes to the serial read/write example at all? 

 

What version of LabVIEW do you have? What operating system are you running?

 

Would you be able to provide a screen shot of the loop back working correctly in Hyperterminal?

 

If you could provide me with this information, I would greatly appreciate it.

 

Kind Regards,

Dom C
0 Kudos
Message 2 of 8
(4,752 Views)

For a 3-wire DB-9 interface (TX, RX, and GND only), connect/short CTS to RTS.

The factory default is hardware flow control enabled, and CTS and RTS connected.


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 8
(4,750 Views)

Hi Clad19

 

Thanks for reply, heres the info you requested.

 

When you mention you have a RN-41 bluetooth module that is communicating with the MCU that the BT module is connected to. What MCU do you have and what BT module exactly?

 

I have an STM32F4 Discovery board and I'm using a Roving networks RN-41-ms bluetoothmodule, on both devices I'm only using RX/TX with flow control disabled.

 

http://uk.farnell.com/stmicroelectronics/stm32f4discovery/stm32f407-usb-otg-discovery-kit/dp/2009276

 

 

http://uk.farnell.com/microchip/rn-41-sm/module-bluetooth-class1-uart-socket/dp/2144010?Ntt=rn-41

 

When you mention you have shorted the TX/RX pins on the BT module, which pins exactly? Would you be able to explain this section in more detail? Perhaps provide some images?

 

I shorted the TX/RX pins on the BT module, like if you wanted to test a serial cable and shorted TX/RX at one end of the cable, so in the case of this bluetooth module pins 18 & 19 shown on pdf manual found at link above (Image attached).

 

Have you made any changes to the serial read/write example at all? 

 

Only the com port and baud rate settings and I've played about with the read delay value, but no actual changes to the VI

 

What version of LabVIEW do you have? What operating system are you running?

 

Labview 2011 and Windows 7

 

Would you be able to provide a screen shot of the loop back working correctly in Hyperterminal?

 

Attached, and not only does the loop back work but I can fully transmit and receive data with the STM32 discovery board and hyperterminal

 

Ive attached screen shot, I don't have local echo set on hyperterminal and it works fine. I make sure all com settings are the same with Labview and I've used the NI M&A explorer to validate com port, I get the same I/O error when testing the port in the NI M&A explorer.

 

I've also attached a screen shot of the error with my MCU program in debug mode showning a break point after the data is sent, I'm not sure if it means much to you but I can definately confirm data is being sent from Labview and activating an interrupt and the send data function is sending the data to Labview.

 

 

0 Kudos
Message 4 of 8
(4,734 Views)

Hi Jeff

 

Thanks for reply, I realised that when I couldn't get it to work with Hyperterminal....took a while though lol.

0 Kudos
Message 5 of 8
(4,732 Views)

Hi icecoldies,

 

Thank you for your detailed response regarding the issue you are seeing.

 

I have been looking specifically at the issue relating to the Error -1073807298 that you have been seeing in LabVIEW.

 

It seems that there is an issue with the VISA buffer. Here are some useful links to look at for the moment:

 

VISA Write Error 1073807298 With mbed

 

Error -1073807298 Occurs after a VISA Read/Write

 

Error -1073807298 with a Third Party Instrument Driver

 

If you could let me know how you get on, that would be great.

 

Kind Regards,

Dom C
0 Kudos
Message 6 of 8
(4,714 Views)

Hi Dominic, thanks for links the first one worked just fine.

 

I added in the VISA Set I/O Buffer Size function, as in first link and set up as suggested, I then tried the loop back test with TX/RX linked on bluetooth module which was successful. I then removed link and connected TX/RX to ST Discovery board and was able to send/read data fine. 

 

I've been trying to save the data to a text file with a VISA Read To File function added into the basic serial/read write (attached), but I'm having a bit of trouble. I'm sure its to do with the termination characters being sent in the string from the ST board. I want the data to save as a list it seems /r/n should provide a carriage return on a new line but its not saving, I've tried /n/r and different variations, some times it seems to save just one line of data and no others but more often it saves no data.

 

I've attached screen shot and VI of basic serial read/write with VISA Set I/O Buffer Size function mod and VISA Read To File mod.

 

Any advice appreciated.

0 Kudos
Message 7 of 8
(4,699 Views)

HI icecoldies,

 

I'm glad to hear that worked out for you.

 

In regards to your issue with the VISA Read to File function, I would take a look at the following links and hopefully these will help you.

 

I believe the issue lies in a setting that needs to be configured for the function using a property node prior.

 

VISA Read to File Overwrites Previous Data

 

VISA Read To File Function

 

Message Based Settings:File Append Enable

 

saving data from VISA read vi to my PC

 

VISA read to file with time stamp

 

I hope these will help you with the issue.

 

Kind Regards,

Dom C
0 Kudos
Message 8 of 8
(4,672 Views)