I have tested the s7plc driver (with the $(id):cmd_gap_pos_cmd record below) and
can confirm that nothing is sent to the PLC when the driver connects and no
output record processes.
If the receive buffer of the PLC is filled with zeros during connection, then it
is probably a problem of the PLC programming.
I can also confirm that exactly one buffer is sent to the PLC during iocInit
after the driver connects and the output records are initialized with PINI=YES.
This buffer does not contain uninitialized space (zeros) if all output records
have been processed with PINI=YES.
I also tested what happens if the PLC is started later than the IOC. The driver
connects and nothing is sent to the PLC until the first output record is
processed after connection.
Thus, I cannot find a bug in the driver.
Again, I strongly recommend to process every s7plc output record in the PINI
phase to ensure that the send buffer of the IOC does not contain uninitialized
zeros. One can use auto-save-and-restore to give values to the output records
before processing them in the PINI phase.
Dirk
Dirk Zimoch wrote:
> Hi,
>
> This should not happen. I will check this. Please send me the configuration line
> from your startup script.
>
> When no output record processes, nothing should be sent to the PLC. However, if
> some output records process and other output records have never processed, the
> unprocessed records send 0. For that reason, I suggest to process every S7plc
> output record at initialization with field(PINI,"YES"). The first package is
> sent to the PLC after all PINI records have finished.
>
> Note that it is not possible to sent "half" buffers. When the IOC boots, the
> buffer is filled with 0. Whenever an output record processes, it writes to the
> buffer. Periodically, the driver checks if any output record has been processed.
> If yes, the whole buffer (including uninitialized parts) is sent to the PLC. If
> no, nothing is sent.
>
> Dirk
>
> Silver wrote:
>> hi, all:
>>
>> I am using s7-plc driver written by Dirk, while I met a problem. while the driver connetcs to plc, it will clear the data buffer of PLC to zero. the database is like following:
>> record(ao,"$(id):cmd_gap_pos_cmd")
>> {
>> field(DESC,"command gap position")
>> field(SCAN, "Passive")
>> field(DTYP,"S7plc")
>> field(OUT,"@Siemens_S7: 0/2 'T=UINT32'")
>> field(LINR,"LINEAR")
>> field(LOPR,0)
>> field(HOPR,4294967295)
>> field(EGUL,0)
>> field(EGUF,429496.7295)
>> field(DRVL,17.0000)
>> field(DRVH,140.0000)
>> field(EGU,"mm")
>> field(PREC,"4")
>> }
>>
>> I remember the Passive mode will not write data to PLC when connecting, but why it can't work? Can anyone give some hints? thanks a lot for your help.
>>
>> Best regards
>> Geyang 2008-11-05
>>
>>
>>
>
--
Dr. Dirk Zimoch
Paul Scherrer Institut, WBGB/006
5232 Villigen PSI, Switzerland
Phone +41 56 310 5182
- References:
- question about s7-plc driver by Dirk Silver
- Re: question about s7-plc driver by Dirk Dirk Zimoch
- Navigate by Date:
- Prev:
Re: Use of waveform records haquin
- Next:
New CVS compiles failed on Windows Zhichu Chen
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
<2008>
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: question about s7-plc driver by Dirk Dirk Zimoch
- Next:
base-3.14.10: CONFIG.Common.linuxCommon: CONFIG-SITE.Common.linuxCommon not called Peter Zumbruch
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
<2008>
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|