LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Desktop PC RT Target communication with host through RS232

Solved!
Go to solution

Hi,

 

I am using desktop PC as RT Target. I want to run a standalone program on RT target when it switches on. The RT target is connected to FPGA through ethernet port. So I want to communicate with host PC through RS232 serial interface to send/receive data as the ethernet communication is not possible. Is the desktop PC RT target compatible with RS232 communication with host and simultaneously with the FPGA target? If yes, is there any protocol for this communication?

I am using LabVIEW 2012 and RT moudule.

 

Thanking in advance,

 

Rashmi

0 Kudos
Message 1 of 15
(4,475 Views)

This doesn't make any sense. What do you mean the FPGA is connected through the ethernet port? Is your standalone RT application separate from the FPGA? You should be able to use the ethernet link for communicating between the RT and desktop computers, regardless of what the FPGA is doing.

 

EDIT: Sorry, I probably misunderstood, I thought you meant you had an NI FPGA in the RT computer. Are you trying to say that have a separate FPGA device (maybe not from NI) that is connected on the ethernet port? If so, any reason you can't put everything on an ethernet switch? You probably can do serial communication between the two computers, but it will be slow, unreliable, and limited in distance.

0 Kudos
Message 2 of 15
(4,466 Views)

Hi,

 

Thanks fo rthe reply.

I will explain in more details.

I have NI 9146 (FPGA) which I would like to control (Configure FPGA, get data through FIFOs and process the data) through RT target (Desktop PC). I have created a RT project in which I have added both the targets. I connected the FPGA first to the host PC and loaded the software and set the IP address. Then I connected the RT target and loaded the software and set the IP address. Now I have written a program in RT target through which I configured FPGA and other processes. But at the same time I have to give the processed data from RT target to Host PC for display. In the development stage, I need to observe the output to check whether the program is running correctly or not. Once that is done, then the RT target needs to be connected to PLC through serial port for the actuators ON/OFF.

 

The processing of data can not be done completely on FPGA as the resourses and timing violations occur. If I use only FPGA and Host PC, then it does not happen in real time. This is the reason why I have to add RT Target in between.

 

Rahmi 

0 Kudos
Message 3 of 15
(4,449 Views)

OK, so your question is really "can I use the serial port on a real-time target"? You plan to use it eventually to talk to the PLC, so your design requires that it work. For testing, you want to use your desktop PC instead of the PLC to see if the RT machine is sending the correct commands, if I've understood correctly. I still don't understand the question in your first post, "Is the desktop PC RT target compatible with RS232 communication with host and simultaneously with the FPGA target? If yes, is there any protocol for this communication?" Why does the FPGA matter, since you're already communicating with it over ethernet? Are you just trying to send the PLC commands over the RS232 link, or something else? It's serial communication - you send bytes and receive bytes. There's no higher-level protocol.

 

Are you sure you need the real-time target, though? If you're only processing data, the host PC might be sufficient. Remember, real-time doesn't mean faster, it just means the timing is more consistent.

0 Kudos
Message 4 of 15
(4,443 Views)

Hi,

 

Thanks for the reply.

The serial port was not detected using MAX so I thought whether RT supports RS232 communication or not. But the problem was I have not installed NI-VISA on RT target. Now it is detecting still I am not able to communicate. Through MAX if I try to open the front panel then it gives error as "You do not have previllage to access the machine/remote system" . I am checking now for this error

I need the RT as I want the PLC communication to be deterministic. If only host PC is used then due to the processing time, PLC communication is not deterministic.

 

Rashmi

0 Kudos
Message 5 of 15
(4,428 Views)

I doubt that you will be able to use MAX to communicate through a serial port on a remote target. Perhaps VISA supports this if you configure the permissions properly, I've never tried. Have you tried running code on the RT target that writes to or reads from the serial port?

0 Kudos
Message 6 of 15
(4,422 Views)

Hi,

 

I have exactly the same problem about the previlage to open the VISA test. In my case, I would like plug an instrument (GPS) to the serial port of the PC target and my the target work in standalone.

I'm stuck cause the serial port resource is not available project tree under the PC target.

Thanks for your help 😉

ced

0 Kudos
Message 7 of 15
(4,398 Views)

I am not able to solve the problem yet. The serial port on the desktop PC RT target is not detected in RT VI with the configure serial port option. How to configure the port and set the baud rate etc.?

 

It is detected in the MAX but not accessible through MAX. If I try to open the VISA test panel through MAX, the following error comes:

 

Error opening resource:
visa://192.168.1.5/USB0::0x0403::0x6001::A6008tmz::RAW

VISA:  (Hex 0xBFFF00A8) Access to the resource or remote machine is denied. This is due to lack of sufficient privileges for the current user or machine.

 

Are there any settings on the host machine or RT target to access the serial port?

0 Kudos
Message 8 of 15
(4,370 Views)

That appears to be a raw USB device, not a serial device.

 

How are you trying to configure the serial port in the RT code? You may not be able to select it from a drop-down list of VISA items, but you can wire in a string such as "COM1" to the VISA functions in place of the VISA refnum.

 

Can you show both your code, and a screenshot of how the serial port on the RT system appears in MAX?

0 Kudos
Message 9 of 15
(4,341 Views)

Indeed I agree with you, Nathand, because I run my VI on the target this morning and the call to the serial port works well even if we cannot drop the serial port icon from the project tree to the VI. That's a good thing but it does not explain why the serial port of the target cannot be tested from the test panel of MAX (no permission allowed!)... I don't mind anyway because the VI works well on the target.

Thanks for your help.

cedric

0 Kudos
Message 10 of 15
(4,330 Views)