LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PLC RS232 Communication without OPC

Hello to everyone.

 

I have an application which I communicate PLC with Labview via OPC server.

I read a variable from PLC.

 

The problem is that the communication is too slow and I lost data in some iterations of a while.

 

I have tryed to change my code for a better implementation but the same happens.

 

So now I am thinking about use another method instead of OPC server like VISA for example.

 

Can I communicate a PLC Panasonic via VISA?

I know I can because I read some articles on the internet but I do not understand really good how...

How can I know what queries I have to use to read a variable which is in a specific addres in PLC?

 

Any help??

 

Thanks a lot!

0 Kudos
Message 1 of 16
(5,257 Views)

Any help pleasse?

 

Thanks a  lot.

0 Kudos
Message 2 of 16
(5,220 Views)

Hi A.,

 

what kind of help do you expect when you don't supply your code nor any documentation of your PLC?

 

The problem is that the communication is too slow and I lost data in some iterations of a while.

I have tryed to change my code for a better implementation but the same happens.

Show your code. Tell us about the communication settings used. Tell us about the capabilites of your PLC.

 

Can I communicate a PLC Panasonic via VISA? I know I can because I read some articles on the internet but I do not understand really good how...

You should aks the manufacturer of your PLC! Or read its manual…

 

How can I know what queries I have to use to read a variable which is in a specific addres in PLC?

Again: read the manual of your PLC!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 16
(5,217 Views)

I don't think that the OPC is a bottleneck in your comm chain. You have RS232 connection in between, and speed of RS232 is a very low in comparison with OPC penalties. For improvement you have in general the following possibilities: At the first, I would like to suggest to looking for PLC with Ethernet connection instead of RS232. Usually PLC suppliers have different types with different connection possibilities. Another idea - check if you can communicate with PLC directly via modbus protocol (toolkit for LabVIEW is available) - with this solution you will eliminate OPC server and probably will be able to optimize communication by reducing amount of polled registers. In case if protocol between OPC and PLC is unknown and non-standard, then you can perform "reverse engineering" with sniffer (PortMon from sysinternals, for example) and recreate it with VISA, but I don't think that you will get huge improvement with this solution (which might take huge time for reverse engineering). By the way - which Panasonic PLC you using currently?

0 Kudos
Message 4 of 16
(5,207 Views)

Hello, first of all thanks a lot for replying.

 

My code is simple, just a while reading a variable from PLC which is a timer (from 0 to 500 ms) and a case which is the timer is 50, 80, 110 or 170 I have to take a image with a camera.

When I arrive at home I will upload a picture of my code.

 

The comunication is with  NI OPC server now.

And this is the PLC manuel that I am using:

https://www.panasonic-electric-works.com/cps/rde/xbcr/pew_eu_en/mn_63489_0010_en_fp0r_hardware_europ...

 

by the way, I have tried with another PLC vie ethernet and it works fine but I need to do with that PLC which does not have ethernet...

 

Any helpt will be appreciate!

 

Thanks a lot

0 Kudos
Message 5 of 16
(5,200 Views)

hello!

First of all thanks a lot for replying.

 

I have tried with ethernet PLC and it works really fine but the problem is that I have to achive this with this PLC which des not have ethernet...

The PLC is this:

https://www.panasonic-electric-works.com/cps/rde/xbcr/pew_eu_en/mn_63489_0010_en_fp0r_hardware_europ...

 

I think I can use modbus but I do not know how...

 

because for example how can I get information about variable which is in adress DT109 in PLC via Modbus (VISA)??

 

Thanks a lot again!

0 Kudos
Message 6 of 16
(5,199 Views)

For modbus: starting point is here:

http://www.ni.com/example/29756/en/

and here is the newest version:

https://decibel.ni.com/content/docs/DOC-30140

 

0 Kudos
Message 7 of 16
(5,193 Views)

Thank you so much!

 

But I do not how I can get information from a variable which is in a specific addres...

0 Kudos
Message 8 of 16
(5,190 Views)

Yout give it a command such as Read Holding Registers.  Let's say the register of interest is 40015.   You tell the subVI to read from register 14.  (Drop the initial range digit, and subtract 1.)  Modbus protocol labels registers starting at 1, but the underlying protocol and the LabVIEW code, the numbering is zero-based.

0 Kudos
Message 9 of 16
(5,186 Views)

Before you go too deep down the modbus hole, a lot of times when you are setting up a PLC-OPC connection, there is a tag update rate that can be set on the OPC server side as well as in LabVIEW when you configure the connections. I would make sure that the slowness isn't just because one of those is too high, it's happened to me before.

Matt J | National Instruments | CLA
0 Kudos
Message 10 of 16
(5,178 Views)