How to Get The PLC Mode

Find and share HowTos to various installations / configurations!
5 posts • Page 1 of 1
chandra
Posts:32
Joined: Fri Oct 06, 2017 12:25 pm

How to Get The PLC Mode

Post by chandra »

Hi everyone


How can I read the PLC mode(RUN/STOP/STARTUP)? and I have seen the internal DPE for S7 Plus driver(State.Connections.OpState) but it is in dyn_uint data type so I am unable to use this to indicate PLC mode.

Are there any functions to read/write the dyn_uint DPE's in Script like dpGet and dpSet?

How to convert the dyn_uint to int or uint?

nmnogueira
Posts:125
Joined: Thu May 05, 2011 12:59 pm

Re: How to Get The PLC Mode

Post by nmnogueira »

You can read the PLC status from _S7_Conn.OpState

chandra
Posts:32
Joined: Fri Oct 06, 2017 12:25 pm

Re: How to Get The PLC Mode

Post by chandra »

Hello

_S7_Conn.OpState is in dyn_uint format how to use this?

nmnogueira
Posts:125
Joined: Thu May 05, 2011 12:59 pm

Re: How to Get The PLC Mode

Post by nmnogueira »

Sorry I thought you were using the S7 driver, not the S7 plus.

You were right, you should be reading from State.Connections.OpState.
You can use dpGet to read from a dyn_int DPE, and access an element using val notation, where i is the element position in the dyn variable. If you only have one connection, you should use val[1] to get the connection state.

chandra
Posts:32
Joined: Fri Oct 06, 2017 12:25 pm

Re: How to Get The PLC Mode

Post by chandra »

Hi

It is working

thank you

5 posts • Page 1 of 1