?? index.htm
字號:
<H2>Juice Plant</H2>
<p>Select the correct <A HREF="#Animation">animation settings</A> to enable the <i>Juice Plant</i>.
</p>
<p>The <i>juice plant</i> diagnostic dialog is shown below</p>
<p align="center"><IMG SRC="images\juice.GIF" ALT="?" BORDER=0>
<HR>
<!------------------------------------------------------------------------------------>
<!--------------------------------- Script Automation -------------------------------->
<a name="Script Automation"></a>
<H2>Script Automation</H2>
<p>
The simulator can be automated from a script, the simulator uses the Microsoft Script Host,
only the VB language is currently selectable. </p>
<p>The primary function of a script is to allow emulation of normal PLC activity. Activity can be based on
SCADA/HMI controls, and be in the form of a response action, or be totally autonomous. To enable the execution
of a script, type in the name of the script VBS file in the space provided in the "Training" settings dialog.
Typical to this kind of scripting, some automation functions have been provided.
</p>
<p><b><font color="#008000">Script function reference:</font></b></p>
<UL>
<LI><b><font color="#0000FF">GetRegisterValue (REG_TYPE as long , ADDRESS as long) As int</font></b><BR>
Returns the current value in the modbus/AB register specified.<BR>
REG_TYPE = register type 0=input, 1=output,2=analog in, 3=holding reg. 4=extended reg. (For AB, this is the file #.)<BR>
ADDRESS = register or I/O point number (Zero always corresponds to the first item.)<BR>
<i>E.g.</i> 0 is similar to 40001 if REG_TYPE is 3<BR>
<i>E.g.</i> 63 would be 64th output coil if REG_TYPE=1<BR>
<LI><b><font color="#0000FF">SetRegisterValue (REG_TYPE as long, ADDRESS as long, REGISTERVALUE as long) As none</b></font><BR>
Set the value in the modbus/AB register specified.<BR>
REG_TYPE = register type 0=input, 1=output,2=analog in, 3=holding reg. 4=extended reg. (For AB, this is the file #.)<BR>
ADDRESS = register or I/O point number (Zero always corresponds to the first item.)<BR>
<i>E.g.</i> 0 is similar to 40001 if REG_TYPE is 3<BR>
<i>E.g.</i> 63 would be 64th output coil if REG_TYPE=1<BR>
REGISTERVALUE = register value, permitted range (-32767 to +32767) other values are clipped, and thus undefined<BR>
<LI><b><font color="#0000FF">DisableStation (STATIONID as int) none</b></font><BR>
Disable a modbus slave station. This function can be used to take the station out of the ring,
as if it was not present in the system/network<BR>
STATIONID = modbus station number (valid values 0 to 255; 0 = broadcast station)<BR>
<LI><b><font color="#0000FF">EnableStation (STATIONID as int) None</b></font><BR>
Enable a modbus slave station. This function can be used to restore a station to the ring. see DisableStation<BR>
STATIONID = modbus station number (valid values 0 to 255; 0 = broadcast station)<BR>
<LI><b><font color="#0000FF">DisplayAbout( ) None</b></font><BR>
Display the application about box, the script is suspended untill the "About" window is closed by the user.<BR>
<LI><b><font color="#0000FF">GetLastRunTime( ) As long</b></font><BR>
Return the duration in milliseconds that it took for the last execution of the script. This value will be -1
on the first script execution, or if the scrip fails to execute to completion without errors.<BR>
<LI><b><font color="#0000FF">StationEnabled (STATIONID as int) As long</b></font><BR>
Return the enable state of the station (0=disabled, 1=enabled)<BR>
<LI><b><font color="#0000FF">TransmitRegisters (STATIONSRC as int, STATIONDEST as int, REG_TYPE as long, ADDRESS as long, REGISTERS as long) As long</b></font><BR>
Sends a value to the desired slave PLC (Simulation must be in and support master mode.)<BR>
Currently not supported on MODBUS.<BR>
STATIONSRC = Allen-Bradley Source station (ignored for modbus protcol).<BR>
STATIONDEST = Destination or target station ID register type 0=input, 1=output,2=analog in, 3=holding reg. 4=extended reg. (For AB, this is the file #)<BR>
REG_TYPE = register type 0=input, 1=output,2=analog in, 3=holding reg. 4=extended reg. (For AB, this is the file #)<BR>
ADDRESS = register or I/O point number (Zero always corresponds to the first item.)<BR>
<i>E.g.</i> 0 is similar to 40001 if REG_TYPE is 3<BR>
<i>E.g.</i> 63 would be 64th output coil if REG_TYPE=1<BR>
REGISTERS = Number of registers to transmit, protocol specific framing or <A HREF="#PDU">PDU</a> limits are not tested before sending.<BR>
<LI><b><font color="#0000FF">AddDebugString (STATIONID as string) As None</b></font><BR>
Sends text to the communications debugger, the text will appear with a double hash ## in front of it.<BR>
<LI><b><font color="#0000FF">TransactionBusy () As long</b></font><BR>
Returns TRUE if this simulation device supports master-mode, and is not busy with a transaction at this time.<BR>
</UL>
<p><b><font color="#008000">Sample script code:</font></b></p>
<!------------------- ------------------------------->
<TABLE width="500" border=0 >
<TR>
<TD width="30">
</TD>
<TD width="400" bgcolor="#008080">
<!---- SAMPLE SCRIPT ----->
<PRE>
dim x
dim n
dim runtime
dim station
n=0
for n=0 to 240
x = getregistervalue(3,n)
SetRegisterValue 3, n, x+1
next
runtime = Getlastruntime
SetRegisterValue 3, 241, runtime
if (StationEnabled (station)) then
Disablestation station
else
enablestation station
end if
SetRegisterValue 3, 242, station
station = station + 1
if station > 12 then station = 0
</PRE>
</TD>
</TR>
</TABLE>
<p>The above sample illustrates how to increment a few registers, and
also turn the communication for the 1st 12 stations on and off continuously. The script runs on every
animation update.
</p>
<HR>
<!------------------------------------- TERMINOLOGY SUB-SECTION ----------------------------------->
<a name="Media Types"></a>
<H4>Media Types</H4>
<p>Media types relate to the physical layers used for any communication process. An example media type
could be a telephone line. Humans popularly use air as a media type; whales use sea-water.
computing devices typically use a copper conductor as a media.
Just in the same way that the amount of air (distance) between two participants and it's temperature etc.
affects the kind of communication that can take place, a physical media type must be clearly defined.</p>
<p>
Device manufacturers typically will refer to a copper conductor of a certain maximum length and thickness,
and then go on to describe other electrical properties of it. So the kind of wire used is important, but
the color is not directly important.<BR>
In some cases a media type variations can also be so clearly defined, that even though 2 media look the same,
they are not. Ethernet 10 base-T is a good example of this kind of case. It even defines transmission rates of
10 million and 100 million bits per second. In addition, because Ethernet is so well defined as a media type of
it's own, converters to other physical media such as fibre or radio are popular, and elevate it to the status
of a protocol. (To be true Ethernet is a protocol, but still refered to as a general media type.)<BR>
<BR>
The simulator supports 2 media types: <A HREF="#RS-232 Setup">Serial</A> and <a HREF="#Ethernet Setup">Ethernet</a>.
</p>
<a name="PDU"></a>
<H4>PDU - Protocol Data Unit</H>
<p>A protocol data unit is that part of a protocol message or frame that contains the data. Data in 99% of protocols
is not simply send without some kind of mechanism to format the data, explain what data it is, and ensure data integrity
and/or security. In total these mechanisms make up a message frame. The message frame contains the data, and since a
message frame cannot be of infinite length, so too, the data is restricted. The restriction thus becomes
the maximum amount of data transmittable in one packet, and will differ as the maximum message or frame length changes.</p>
<p>DF1 specifies a PDU of 234 , 223 bytes if over IP : for SLC5/03 or 5/04<BR>
for the SLC 5/01 or 5/02 only 82 bytes (equivalent to 41 words)</p>
<HR>
<!------------------------------------------------------------------------------------>
<!--------------------------------- More (... F.A.Q.) -------------------------------->
<a name=More>
<h2>F.A.Q. More info.</h2></a>
<ul>
<li><b>Q: </b>What is a MODBUS RTU? <BR>
<b>A:</b> It's a PLC, if that does not
make sense, visit www.modicon.com.</li>
<li><b>Q: </b>Where do I get the protocol? <BR>
<b>A:</b> Visit www.modicon.com, and search for PI-MBUS 300.</li>
<li><b>Q:</b> How do I do XYZ? <BR>
<b>A:</b> Some program features are not documented at this time, look around.</li>
<li><b>Q:</b> MODBUS function 5 returns the old value<BR>
<b>A:</b> There is however one variation on the MODBUS documentation, for function force single coil 0x05 -the simulator
responds with the value before modifying the actual coil, not after modifying the coil. This was wrong, but
was easiest to implement, and there is now a setting for this. (See Emulation settings - Hotkey <CTRL>-M)</li>
<li><b>Q:</b> Where is the help file?<BR>
<b>A:</b> The help-file is all in HTML, all images and the text are stored in the program, adn placed into the current working folder.
Editing them will have no affect without re-compiling the simulator.</li>
<li><b>Questions/problems :</b> mail me at <a href="mailto:conradb@adroit.co.za">conradb@adroit.co.za</a>.</li>
</ul>
<HR>
<p><font size="1">This page was developed using TextPad "http://www.textpad.com/
", do not edit on fear of death.</font>
</p>
<p align="right">ZåPHoÐ</p>
</BODY>
</HTML>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -