Jump to content

LabVIEW and OPC server (Softwaretoolbox TopServer)


Recommended Posts

Hi,

I´m having problems accessing an OPC server in 2 parallel loops.

I have LabVIEW 7.1 (GOOP inheritence toolkit) and an opc-server (software toolbox TopServer)

I made an object oriented driver called ´The communicator´ (what´s in a name ). With it´s methods I can read and write items to S7 and S5 PLC´s.

A bit in detail:

When creating my communicator object; I create a number of virtual plc´s and a number of S5 subPLc´s if the VPLC is an S5.

S5 is a bit special: I use a DLL to communicate and I use the simulation driver of the OPC server to store my send and receive strings for S5

This driver is used in about 50 programs, each program initiates 15-30 Virtual PLC´s and accesses 50-150 TAGS on the server.

When i need to communicate with S5 and S7 in 1 program, I made 2 loops because s7 is much faster then S5. With my methods read S5 and Read S7 I acces S5 PLC´s in loop1(looprate 15s) and S7 PLC´s in loop2 (looprate 300msec)

Sometimes I see 2 clients popup in my OPC server and then all systems hold. CPU usage only 5% and memory only 300MB of 2Gb. I don´t get errors in the OPC subvi´s while writing or reading. When he systems holds, there are also no errors (I use the LabVIEW OPC subvi´s, the yellow functions)

I tried to split up S5 and S7 in seperate communicator objects to get a memory block for S7 communication and one for S5. Result is that I still have 2 OPC clients.

When I put everything in 1 loop (so S7 comm. is quite slow) I only have 1 client and no crashes.

I think LabVIEW makes an extra client (1 for each loop) and that makes my program crash. is there a way to have only one LabVIEW client and use parallel loops ?

At creation of the object I open all OPC connections and store the ref´s in an array. In case of error I close and reopen. At shutdown I close the reference, but i don´t want to shutdown because it is a visualisation and steering of an industrial process that runs continiously.

I hope my story and question is clear to you. If you need more info to be able to give me advice please ask, I will check the topic frequently.

Thanks in advance.

Regards,

Wim

Link to comment
  • 4 weeks later...

Hi all,

I have found a bug in my driver, not related to OPC crashes but it speeds up my reading loop so I no longer need to split up S5 and S7 reading. Looptime is acceptable to put them in one loop.

So problem solved ... :rolleyes:

Greetings.

Link to comment
  • 1 month later...

Hi Wim,

I am doing same what you are doing i am using the plc with OPC server but problem is i had 150 tags had having the 3 different VIs which is share 50 tags each at the back three process are running for each VIs when i run on my pc it is communication fine but when i run on my client PC in b/w the communication got failed i donot know why will you please help me to solve my problem i had also post my thread in ni.http://forums.ni.com/ni/board/message?board.id=170&thread.id=430655

Link to comment

Hi,

I've read that you are using shared variables. I've never used this so can't help you with this one.

I used the Datasocket VI's ( the yellow datasocket VI's) to open a reference, then Read/Write to the datasocket TAG and close the ref when closing the program or when I detect an error.

Maybe you can try these VI's.

Good Luck,

Wim

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.