Hello,
I would like to set the modbus driver number through address config. But there is no attribute which takes driver number. Do i need to use a different config to set the driver number or any other solution through scripting.
Thanks in advance
Regards,
Raj
How to set driver number through address config
- rajkumar.krishnan
- Posts:20
- Joined: Fri Mar 07, 2014 2:46 pm
How to set driver number through address config
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: How to set driver number through address config
Hello,
the driver number is specified with the _distrib-config. This information is not part of the _address-config.
When modifiying the _distrib-config all driver related configs are deleted and have to be created again.
Best Regards
Leopold Knipp
Senior Support Specialist
the driver number is specified with the _distrib-config. This information is not part of the _address-config.
When modifiying the _distrib-config all driver related configs are deleted and have to be created again.
Best Regards
Leopold Knipp
Senior Support Specialist
- fmulder
- Posts:330
- Joined: Wed Feb 03, 2010 9:46 am
Re: How to set driver number through address config
Note that the _distrib config 'lives' in the Event manager. This also means that you can do a dpQuery() to ask for all items that have a certain driver number. The _distrib config tells the Event to what driver to send the messages to.
The _address config lives inside the driver(s) (and not in the memory of the Event). This also explains why you can't do a dpQuery() on this config.
You always have to set the two in combination.
A good tip to know how this can be done is to simply text-search for the text "_distrib" in the various WinCc OA scripts. You'll find script code where this config is set.
For example:
You'l find
(where 'config' is _address ! )
dpGet(dpe+":"+config+".._active",active,
dpe+":"+config+".._reference",reference,
dpe+":"+config+".._subindex",subindex,
dpe+":"+config+".._mode",mode,
dpe+":"+config+".._reply",reply,
dpe+":"+config+".._datatype",datatype,
dpe+":"+config+".._drv_ident",drv_ident,
dpe+":_distrib.._driver",driver);
The _address config lives inside the driver(s) (and not in the memory of the Event). This also explains why you can't do a dpQuery() on this config.
You always have to set the two in combination.
A good tip to know how this can be done is to simply text-search for the text "_distrib" in the various WinCc OA scripts. You'll find script code where this config is set.
For example:
You'l find
(where 'config' is _address ! )
dpGet(dpe+":"+config+".._active",active,
dpe+":"+config+".._reference",reference,
dpe+":"+config+".._subindex",subindex,
dpe+":"+config+".._mode",mode,
dpe+":"+config+".._reply",reply,
dpe+":"+config+".._datatype",datatype,
dpe+":"+config+".._drv_ident",drv_ident,
dpe+":_distrib.._driver",driver);