06-29-2017 08:14 AM - edited 06-29-2017 08:16 AM
So I have a cDAQ-9132 Linux RT system and I want to find my options for serial control. Looking at MAX I have ASRL1::INSTR, and ASRL2::INSTR. I found a couple of USB RS-232 devices and after plugging it in MAX showed an ASRL3::INSTR. Using the Simple Serial on Windows, and Simple Serial on the RT target, and using ASRL3, and COM1 on Windows, I am able to send serial from the Windows PC and get it on the RT target. I tried two different USB serial devices on the RT chassis and they both worked fine.
Next I went to try to use the on board serial. It is connected through a RJ45 connector, and is on page 1-39 of the manual here. Now this RJ45 is a 10 pin, not an 8 pin like most ethernet cables, but I don't need pin 1 or 10 so I figured I would be okay using an ethernet cable. So I took the brown, and brown with white stripe from the standard ethernet pinout which should be pin 8 and 9 from the manual linked to earlier.
I connected pin 7 in this cable which should be the TX on the cDAQ, to pin 2 on my DB9 (which should be RX) and then pin 8 on the ethernet cable should be RX on the cDAQ to pin 3 on the DB9 (which should be TX).
My issue is that using ASRL1, or ASRL2, or swapping the TX and RX lines, never worked. So why are there two VISA devices one for ASRL1 and one for ASRL2? Does my chassis have two serial ports? Is my pinout incorrect? Oh this is also with the console output turned off in MAX. Any suggestions? Thanks.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
Solved! Go to Solution.
06-29-2017 08:41 AM
Hi Hooovahh,
On the cDAQ manual it is written that the RS232 port is a RJ50 (and not a RJ45). Plugging a RJ45 into a RJ50 (which is possible) you might have a problem aligning the contacts of the male/female sockets... Am I wrong ?
06-29-2017 08:47 AM
Soory about the last post, I am wrong...
07-07-2017 07:33 AM
I got a friendly reminder email from the forums asking if this has been resolved. I know this was a holiday week so support from NI is probably limited but could someone help me out on answer my question on how to use the RS-232 on an embedded cDAQ? Thanks.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-10-2017 04:49 PM
There is a possibility that you need to look deeper into the connections. I think this KB will provide some details.
Converting an RJ50 Serial Connector to DB9 or DB25
From <http://digital.ni.com/public.nsf/allkb/2EF59B02FFFCCB3486256914006442EF>
07-11-2017 10:16 AM
Yeah that seems to be the same information as what is in the document I linked to earlier. On the 10 pin cable pin 9 goes to pin 2 on the DB9, and pin 8 goes to pin 3 on my DB9. I also swapped the TX and RX, along with trying both the ASRL1 and ASRL2. As I mentioned with I didn't have a 10 pin RJ-50 but have tons of 8 pin RJ-45s. So I used pins 7 and 8 on the RJ45, instead of 9 and 10. Since the pins are centered in the connector I thought this would work. Should I assume the RJ50 cable that NI sells here is compatible.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-12-2017 06:19 PM
I connected pin 7 in this cable which should be the TX on the cDAQ, to pin 2 on my DB9 (which should be RX) and then pin 8 on the ethernet cable should be RX on the cDAQ to pin 3 on the DB9 (which should be TX).
From page 49 of the cDAQ-9132 manual, it says that 8 and 9 are TXD and RXD (see below). Are you sure you have everything wired in correctly?
1: No Connect
2: RI
3: CTS
4: RTS
5: DSR
6: GND
7: DTR
8: TXD
9: RXD
10: DCD
I saw an instance of someone using RJ45 in RJ50 successfully before, the outside pins are the ones with no connection.
RJ45 cable into RJ50 jack NI9237
https://forums.ni.com/t5/Digital-I-O/RJ45-cable-into-RJ50-jack-NI9237/td-p/3242987
If the port is RJ50, though, probably best to use RJ50. Which port are you wanting to interface with on your PC?
07-13-2017 08:49 AM - edited 07-13-2017 09:08 AM
Thanks for the link, it didn't come up in my search earlier for some reason. I do believe I'm using the correct pins. Here is a terrible illustration.
We want pins 8 and 9 on the RJ50. We see that if the connector is centered then pin 2 through 9 on the RJ50 connect to pins 1 through 8 on the RJ45. This means pin 7 on the RJ45, is pin 8 on the RJ50, and pin 8 on the RJ45 is pin 9 on the RJ50. Since pin 8 and 9 on the RJ50 is what I want, then this means that I need to use pins 7 and 8 on the RJ45. So what I stated earlier that pin 7 on in the RJ45 should go to pin 2 on my DB9, and pin 8 on my RJ45 should go to pin 3 on my DB9, I think is correct.
I've taken a meter from the RJ45 pins 7 confirmed it goes to pins 2 on the DB9 plugged into the PC. I also confirmed pin 8 on the RJ45 goes pin 3 on the DB9. On the Windows side I tested that COM1 is the correct port by adding a USB to RS-232 adapter on the controller and am able to use this properly.
I also took a screencast for my sanity but it doesn't help with it.
https://www.screencast.com/t/aS6EvxlgkU
Basically it shows me using the 3rd VISA device which I added with a USB to RS-232 and it works fine, but when I go to use the 1st or 2nd VISA device I can't get it working. Attached is the simple project I showed where I just read on Windows and just write on RT.
Is there something else I need to configure in software to enable this? Is there something else I'm not doing? Again why is there two ASRL devices by default? Which should I be using? I've never known RS-232 to need more than the two pins, is it possible I need to wire other pins?
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-13-2017 09:14 AM - edited 07-13-2017 09:16 AM
Okay I'm an idiot, ground is also needed. So for anyone else looking to use the RS-232 using a RJ45 cable, take pin 5 on the RJ45, connect it to pin 5 on the DB9, take pin 7 on the RJ45 connect it to pin 2 on the DB9, and then pin 8 on the RJ45 goes to pin 3 on the DB9. This already swaps TX and RX so no other null is needed. This was with ASRL1. Not sure what ASRL2 is for.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord