Home

ScadaMobile 2_1_1

image

Contents

1. If the default validation tag interferes with your project you can set a custom one with the validation_tag attribute When you use custom validation tags you must follow the following points Be sure to have the same validation tag in all files sharing a single connection i e with identical communication settings oth erwise one or more files will appear as dissociated on the Connections view If you explicitly set the validation_tag attribute to the default one you will still have to do the same in all your files sharing a connection e When you explicitly set a validation tag you will have to explicitly set a non zero value for the validation code as using 0 as validation code is explicitly forbidden in this case and doing so will always fail the validation check pag 72 86 www sweetwilliamsl com sweetwilliam ScadaMobile 10 Background Task Processing You can tell ScadaMobile to keep connections alive even when the device iPhone iPod is locked Additionally ScadaMobile supports running in the background during a finite period of time on multitasking enabled devices On the settings tab there are two switches that allow for enabling such options Keep connected Lon 8 Background process on Keep connected When ON ScadaMobile will keep any open connection as is and will continue polling PLCs even when the device is locked This is intended to help keeping alarms and graphs updated but it may have a nega
2. in_INTValue_ReadOnly INT in_UINTValue_ReadOnly UINT in_DINTValue_ReadOnly DINT in_UDINTValue_ReadOnly UDINT in_REALValue_ReadOnly REAL INTValue_ReadOnly INT INTValue INT UINTValue_ReadOnly UINT UINTValue UINT DINTValue_ReadOnly DINT DINTValue DINT UDINTValue_ReadOnly UDINT UDINTValue UDINT REALValue_ReadOnly REAL REALValue REAL IR4 IR6 IR8 IR10 HR4 HR4 HR5 HR5 HR6 HR6 HRS ord 02 section DISCRETE INPUTS ord 04 section DISCRETE INPUTS ord 205 section COILS ord 206 section COILS ord 207 section COILS ord 208 section COILS ord 208 section COILS ord 208 section COILS label Default Read Only BOOL comment This is Coil 1 write_access 9 label Default Read Write BOOL comment This is Coil 1 too label Custom Read Only BOOL on_label OPEN off_label CLOSED write_access 9 label Segment Style BOOL style segment_switch write_access 9 label Default Button Style BOOL style button write_access 9 label Labeled Button BOOL style button button_label START ord 311 section INPUT REGISTERS ord 314 section INPUT REGISTERS ord 321 section INPUT REGISTERS ord 324 section INPUT REGISTERS ord 330 section INPUT REGISTERS ord 411 section INT HOLDING REGISTER ord 412 section INT HOLDING REGISTER write_access 9 ord 414 section UINT HOLDING RE
3. access and write_access See Specification of Attributes Only users who have an access level equal to or greater than the one set for a particular variable will be able to view or edit it The purpose of user accounts is to make possible that a PLC programs developer or integrator would create a pre configured solution for a particular final customer A final customer does not usually need to change communication settings or to modify attributes This is normally a developer s responsibility Therefore by setting user accounts and leaving the administrator pass word private a developer can choose to provide customized safe access to a process being monitored User accounts can also help to prevent non authorized persons from interacting with remote processes by getting physical ac cess to an iPhone with ScadaMobile installed Two accounts are set up by default with the following names passwords and access levels administrator nobody The administrator account lets you create additional accounts with intermediate access levels as well as to select active ac counts It is strongly recommended that you change the default passwords once you have a running configuration in place Note that there is no way to retrieve a lost password The only way to recreate the original passwords is by removing ScadaMobile from your iPhone and iTunes and reinstalling from the App Store If you ever need to do so be sure your Sou
4. sweetwilliam ScadaMobile User Manual Version 2 1 1 www sweetwilliamsl com A DE ui sweetwilliam What is ScadaMobile ScadaMobile SacadaMobile is a native iPhone and iPod Touch application for real time monitoring of industrial PLC based systems and proc esses In can be applied to building automation industrial process control mini hydro power plants water plants and anywhere where reliable instant access to real time remote data is essential Main features V Local or remote access Any number of concurrent PLCs V Very fast independent of project size immediate connection and display V Boolean Integer and Floating Point values vV Advanced Strings and Arrays Support V Direct file import from Excel V Configurable Accounts and Access Levels vV Alarms Trend Graphs V Lookup Texts Expressions V Direct connection to PLCs and RTUs without servers V TCP IP based security How you can use ScadaMobile in 5 simple steps 1 Create an Excel spreadsheet with the specs and behaviors of the Vari ables to be controlled See Data Source Files 2 Export or Save into a CSV file 3 Import the file created in step 2 into ScadaMobile See Import 4 Set the PLC IP address in ScadaMobile if you did not so in step 1 See Network access Ol Monitor process variable states and values from anywhere pag 2 86 all movistar 4 S SCaAaFr Weight Value Linked to severa
5. B3 Binary T4 Timer C5 Counter R6 Control Nn Integer File n is file number Fn Floating Point File n is file number STn String File n is file number W Work area D Data Memory Area DM T Tim Counter Area T C H Holding Register Area HR A System Area AR Area E Extra Memory EM Area no prefix I O Area I Input Discrete read only C Coil IR Input Register read only HR Holding Register Micrologix controllers Examples B3 5 would access word 5 on file 3 of type B N7 0 would access value at position 0 in N7 File N7 0 3 would access bit 3 in N7 0 Individual bits are specified by following a dot anda number from 0 to 15 For example W10 5 refers to bit 5 of W10 To access Coil number 10 specify C10 To access Holding register 1 specify HR1 Individual bits in HRs can be accessed for reading or writing using a dot notation For example HR1 3 would refer to bit 3 in HR1 www sweetwilliamsl com Siemens ISO_TCP Siemens S7 sweetwilliam Area Prefixes E Inputs l same as E A Outputs Q Same as A M Internal Flags DBn DB Data block Valid Size Modifiers after Area Prefix X Any size or 1 bit size B byte 8 bits W word 16 bits D double word 32 bits ScadaMobile Tags are addressed by Area and Size in the usual way for S7 controllers Examples E2 3 accesses bit 3 of input address 2 12 3 same as above English notation
6. IMCKpeTHble gaTUUKu eI o aa Arrays Arrays are indexed collections of objects Each element in an array is associated with and referred to by an index Array indexing starts at 0 A negative index is assumed relative to the end of the array that is an index of 1 indicates the last element of the array 2 is the next to last element in the array and so on Arrays can hold any objects such as Numbers Strings or other Arrays Arrays can be read from or written to PLC or can be cre ated on demand in expressions by just enclosing their elements in square brackets pag 43 86 www sweetwilliamsl com sweetwilliam ScadaMobile Example element at index 0 123 4 L 33 temperature The above expression represents an array of three elements At index 0 we have a literal string element at index 0 At index 1 we have a numeric value 123 4 At index 2 we have an array of 2 elements with the number 33 and the variable temperature as their components Elements of the referred array can be accessed by index as shown next element at index 0 123 4 L 33 temperature 1 wouldreturn 123 4 element at index 0 123 4 L 33 temperature 3 would return element at index 0 element at index 0 123 4 L 33 temperature 1 0 wouldreturn 33 L element at index 0 123 4 L 33 temperature 2 L 1 would return the value of temperature pag 44 86 www sweetwilliamsl com weetwilliam ScadaMobile 3 1 11 2 Suppor
7. MB14 accesses address 14 on the flags area as a 8 bit value MW14 accesses address 14 on the flags area as a 16 bits value MD14 accesses address 14 on the flags area as a 32 bits value DB2 DBW6 accesses address 6 on Data Block number 2 area as a 16 bits value DB4 DBX8 accesses address 8 on Data Block number 4 area Size depends on actual type specified type on none 1 bit size column B Accessing data types longer than one register For data types requiring more than one register or memory location the lower address in their range must be specified For ex ample a variable of type DINT addressed by HR100 will use HR100 and HR101 because 2 Modbus registers 16 bits are re quired to accommodate the complete variable 32 bits Integrators must be aware of it to avoid overlapping tag values This ap plies to all protocols but EIP Native Accessing a Register as a BOOL It is possible to specify a BOOL type for a register or memory location even if it is not meant to hold a BOOL You can for exam ple specify on a row that HR1 is a writable BOOL In such case ScadaMobile will use a switch control for that row and will write a value of one 1 or zero 0 to the register depending on user interaction on the switch EIP Native Siemens ISO_TCP does not allow a non BOOL PLC Tag to be treated as BOOL due to the strict type checking that this protocol encourages You can use the bool style instead to force the same effect S
8. ScadaMobile Document Revision History Refer to this section to look at changes on this document over different versions Version 2 1 0 Replaced occurrences of Tag by Variable where referring to SM Variables as opposed to PLC tags Added section Representation of Character Strings in PLCS Added Siemens ISO_ TCP in the list of supported protocols and references to it where relelvant Updated description of the value tag attribute in Tag Attributes section Added sub section Global Attributes for Siemens S7 Controllers under Global Attributes heading Updated sub section Multiple range lookup tables under Look up Tables heading Changes in section Data types in Expressions Updated section Performance Removed Example PagesExampleEIP csv Added Example CommunicationsState csv Added Example International ONE txt Added screen shots for Example Aphorism ONE csv Version 2 0 0 e New styled table of contents Added section Tag Scope Added memory arrays definition in section Specification of Variable Types e Mention of how to specify communication protocol in section Specification of Variable Addreses Incorporated references to the new strings type in section Specification of Variable Addreses Added reference for accessing program tags in Logix controllers in section Specific
9. ScadaMobile Group 2 Someone Manipulated the Switch 2 total active alarms www sweetwilliamsl com sweetwilliam ColorfulControlsModbus csv ScadaMobile Presents ways to specify colors based on value in tags and controls The example is based on the Modbus TCP protocol wall movistar gt 16 05 4 Page 1 COLORED BUTTONS Push Red to do something Purple Colored Button Push Purple to do something Olive Colored Button Push Olive to do something Green Colored Button Push Green to do something Default Button Push Button to do something COLORED VALUES DarkRed Red Default Red DarkRed Select Value for tag above MIU sal PURPLE OLIVE 7 239 146 239 146 Colored Value Dark Blue above 100 Red above 200 Colored Input Value Dark Blue above 100 Red above 200 ColorfulControlsEIP_PCCC csv 266 9 266 9 Range 20 to 80 SIMULATED CONTROLS Temperature 15 4 C r n Moisture 68 9 l Identical to the previous one but based on the Ethernet IP PCCC protocol CommunicationsState csv il movistar gt 16 06 Page 2 7 A ge INDICATORS Moisture 68 9 e Light 89 1 _ __ _mnl ii iio STATUS Temperature Temperature within 10 to 35 C normal range Moisture ui i Range 20 to 80 Within range high Light Too high Uses the system communication state global variable and displays
10. expr2 is executed instead Items between brakets are optional The if then else clause 2 differs from the ternary conditional operator 1 in the following ways 1 executes when any of expr expr1 expr2 generate a change event The result is always updated and will be consistent with the values of expr expr and expr2 at all times The execution will in turn trigger relevant change events up the expres sions tree just as any expression would do 2 only attends to expr change events Any changes in expr1 or expr2 will not have an effect until expr executes Furthermo re if expris false and expr2 was not specified the execution tree is trimmed at this stage and no further execution up the ex presion tree will happen 2 is useful in cases where you want to achieve a differential effect for example to trigger an event when a condition goes from false to true but not the oposite This is not possible with 1 because it will always execute both ways Consider the following start BOOL INTERNAL label Start Button style Button write_access 0 stop BOOL INTERNAL label Stop Button style Button write_access 0 motor BOOL Ci label Motor State value if start then 1 else if stop then 0 The previous lines will display a Start tand a Stop button When the Start button is touched 1 will be written to C1 When the stop button is touched 0 will be written to C1 Another use of the if then else clause is the implemen
11. is propagated through the relevant links to reach only the expressions that need to know about it generally only a few The result is that expressions execution time is basically independent of project sizes or the total number of expressions defined in projects The Event Driven Architecture is specially suitable for running ScadaMobile in the constrained environment of a mo bile device and still be able to support a very large number of tags with no noticeable performance penalties Using Expressions ScadaMobile expression syntax is based on the open source Ruby scripting language syntax For basic operations this syntax is similar to that of the C programming language and virtually identical to all modern scripting languages The Ruby language was chosen because it features a clean easy to learn object oriented syntax with a particular focus on ex pressions allowing for practical ways to represent and dealt with several data types and formats with great flexibility ScadaMo bile supports most operators including all common Logical Arithmetic and Comparison operators as well as commonly used Ruby functions and methods Support of Ruby expressions in ScadaMobile is a subset of the Ruby language Expressions are not and do not pretend to be a complete implementation of Ruby In some cases we provided a single way to accomplish something that can be done in sev eral ways on Ruby and in other cases we integrated several functionalitie
12. testTag 1 will contain C2 Array element 9 testTag 9 will contain C10 3 Accessing regular PLC memory as single values valid on all protocols BOOL SINT INT DINT REAL STRING CHAR n in column B e HRx in column C The variable in column A gets the value of HRx taking either the full register or the necessary following registers to hold the complete value For types that are shorter than the actual register size the value in the PLC register is taken as a whole rather than trimmed to a shorter type Example get DINT at HR1 testTag DINT HR1 testTag will contain the DINT value contained in HR1 HR2 this is because DINT is 32 bits long and HRs hold 16 bits each Example get HR1 as a BOOL testtag BOOL HRI testTag will contain 1 true if HA7 is not zero or 0 false otherwise HA7 raw value is therefore interpreted as boolean pag 21 86 www sweetwilliamsl com sweetwilliam ScadaMobile 4 Accessing regular PLC memory as an array of values valid on all protocols e SINT n INT n DINT n REAL n STRING n in column B e HRx in column C The variable in column A will be an array containing n elements of the specified type The array gets its values starting from HRx taking the necessary following registers to complete all its data according to data type size Data is packed as it is found in PLC memory for types that are shorter than the actual PLC register size Example get array of 2 REALs starting at HR
13. 1 stops Low Level Set Point L Level at which pumps start 346 172 15 4 500 350 100 7 Valve 1 Completely Open OPEN Limit Switch Valve 1 Completely Closed Man Auto Manual Open will stop process Hidden Tab Bar and Navigation Bar iPod 22 32 a Status Bar _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _ _ _ _ ________ __ POO mme E eEEOeERlee lt DW hll iDg Tags Table To optimize the available space on the Home Tab view users can chose to hide the Jab Bar as well as the Navigation Bar as shown on the above screen shoots You can interact in the following ways on these basic interface elements To hide or to show the Tab Baron the Home View use the Hide bottom bar option on the Settings tab To scroll to top of the tags table tap on the status bar of the iPhone screen To hide or to show the Navigation Bar on the Home View use a scroll down gesture as you are on top of the tags table To switch from one page to another use a scroll left or scroll right gesture on the page title Alternatively tap on the right or left sides of the Page Control on the Navigation Bar next to the page dots To show or to hide the Page Control on the Navigation Bar use the Paging Enabled option on the Settings tab To navigate to the list of pages tap on the Navigation Bar left button To see alarms or trend g
14. 3 write_access 5 pag 59 86 www sweetwilliamsl com A gt sweetwilliam ScadaMobile 4 File Import into ScadaMobile ScadaMobile features an embedded Web server to let users to access to their file contents and to perform various operations Follow the steps below to use the integrated Web Server 1 Go to File Server tab NOTE In order to have access to files you must log into the administrator account The initial password is admin ScadaMobile sets itself to this account on first launch See User Accounts 2 Switch on the File Server 3 With ScadaMobile s File Server started copy on your PC s Web browser the IP address provided If you use Apple s Safari browser you can simply click on the relevant Bonjour link 4 Now use the available options on the displayed web page in order to move files to from ScadaMobile You can upload any files and store them in your iPhone iPod O MMe GY http 192 168 1 53 8080 gt Google P names as default templates for example user modified template files will be preserved so you may have to delete them in A order to recover full original state Load Templates File Download ScadaMobile gt PC ill Carrier gt 5 14 PM File Server Click or Right Click on a file name in the list to download it to your computer Click Delete to remove a file from your iPhone Files can be transfered between DataTypes cxr 1 9KB 3 9 10 11
15. Internal tags are stored and managed inside the ScadaMobile app Internal tags mostly behave as actual PLC tags except that they are not linked to an actual PLC address Thus internal tags do not require an active TCP connection to display a value In combination with expressions internal tags are a powerful feature that allows for presenting calculated values to the user or holding intermediate values for subsequent use Internal tags support most of the available attributes except the ones specifically targeted at PLC tags such as the scale attrib ute To specify that a Tag is internal use the word INTERNAL instead of a PLC address or Symbolic Tag INTERNAL Indicates that this tag does not have a link to an actual LOCAL deprecated PLC tag Instead it exists only in the app Internal tags can be used to store and represent intermediate values or expression results Just as regular PLC tags internal tags can be associated to Local or Global scope variables To identify a variable associated to an Internal tag to have a Global scope just prefix it with a sign pag 20 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 3 2 PLC Memory Arrays It is possible to read or write consecutive memory locations in the PLC as memory arrays and store them on a single variable In order to do so you define the array size next to the specification of variable type Column B ScadaMobile will read the specified number of values and w
16. UTF 16 file is given See International Characters Support The STRING type should be used with the appropriate string memory area or string tag type in controllers supporting them The use of the STRING data type is not limited to controllers with particular support for strings See section Representation of Character Strings in PLCs below for further information pag 13 86 www sweetwilliamsl com sweetwilliam ScadaMobile rt rr IfA Ii _ DATA TYPE REMARKS CHAR size Similar to STRING except that it does not insert a leading length word It can be used on protocols with no specific support for strings such as Modbus In this case size indicates the string buffer length i e the number of character bytes that should be allocated in the PLC for the string starting from the address specified in column C Note that CHAR 20 would technically mean an array of 20 character bytes however in this case it will be treated as a single string with a capacity of 20 bytes Keep in mind that if you use a string encoding other that the default you must expect the string to have a capacity of less than size characters This is because on some encodings a single character may require multiple bytes to be represented In the future we will make the size specification available for CHARs just like the STRING type This will allow for having arrays of strings of char For example CHAR size n will represent an array of n string
17. a CX Programmer s symbol table This file was created in CX Programmer but does not require any program in the PLC FillATank cxr This is the most comprehensive example for Omron PLCs and it consists of a simulation of a water tank that is continuously emptied and filled by means of two Valve and Pump pairs with configurable levels and flows The file was created in CX Programmer and includes a complete program section that can be imported and run in any sup ported Omron PLC Since the process is actually simulated and run by a PLC it should be transfered to a PLC in order to get meaningful monitoring on ScadaMobile This example also features several access levels for the monitored process variables so you will also be able see how variables display change depending on current user s access level iPod 21 39 4 LECE p A _ _ __ __ 7_1_ Main Run Stop Switch Main Process Start Stop Mo Tank Level L Water Tank Current Level 214 163 Output Flow L s 15 4 Current Output Flow from Tank High Level Set Point L 500 Level at which pumps stop Mid Level Set Point L 350 Level at which pump 1 stops Low Level Set Point L Level at which pumps start 100 7 Limit Switch Valve 1 Completely Open OFF Limit Switch CLOSE Valve 1 Completely Closed NOTE The provided PLC program section uses TIMX instructions so you may have to select Execute ti
18. a syntax error on the second assignment operator Do not confuse the assignment operator with the the equality operator which is fully supported An expression is executed only when at least one of the referred variables or tags change The process is totally trans parent and integrators might not need to know about how it works underneath However keeping the event driven nature of ScadaMobile in mind can help integrators to understand why and when PLC tags will be written or alarms will trigger as a con sequence of an user interaction or PLC Tag change that originated a cascade of change evenis Expressions containing Logical operators are no exception to the event driven design They will be fully executed even if a change occurs on the right side of the Logical operator For example the expression value conditionl amp amp condi tion2 will be always false if condition1 is false however it will execute anyway as a consequence of a change on con dition2 Although the expression result will not change it will remain false the engine will still send a change event to any referring expressions which could potentially cause other effects such as a PLC tag rewrite if the expression was linked to a PLC tag Expressions are not allowed to create circular or recursive references This means that a result of an expression can not be refitted to another expression that ultimately would send a change eventto the originating expression This i
19. delimiters generated by Excel OpenOffice NotePad etc V csv generated by RS Logix vV Cxr generated by CX Programmer NOTE The recommended way to generate source files is to begin with one of the provided examples and then continue by editing what is missing pag 60 86 www sweetwilliamsl com A lt We otwilliam 4 2 Other Files supported by ScadaMobile In addition to Source Files ScadaMobile is able to store and display a number of additional file formats The following file types with no aim to be exhaustive are supported for display V Excel xIS V PDF pdf V Powerpoint ppt V Word doc V Rich Text Format rtf Vv Image files png jpg gif The possibility of storing and viewing files can be useful to document specific configurations or simply to move documents between computers ScadaMobile is able to store any file types even those that are not supported for display 4 3 Custom Company Logo ScadaMobile Fies ScadaMobile1_2ES pdf Esd SweetWilliam ScadaMobile You can place a custom logo on top of the Home view when the list of pages are seen You do this by using the available op tions on the Web Page provided by the integrated Web Server On the left screenshot below an imaginary company logo is shown alongside the same screen with the default logo on the right iPod 14 20 iPod 14 21 Overview gt Overview Valve Control B gt Valve Control Process D
20. done by setting a Validation Code both in the PLCs and ScadaMobile which will prevent ScadaMobile to access PLCs unless both codes match Next section describes validation codes and how you can set them up Finally physical access can compromise security It is relatively easy for an unauthorized user to gather physical access to a device and run a remote monitoring application To fight this possibility ScadaMobile s user accounts provide password based security By setting off the automatic login switch in ScadaMobile settings tab a password key will be asked each time the app is launched thus preventing people not knowing the password from using the app Additionally Apple provides a service for blocking lost or stolen devices so that no one is able to access to data or execute apps in them until the real owner reactivates them pag 70 86 www sweetwilliamsl com sweetwilliam ScadaMobile 9 1 Validation Codes For most protocols ScadaMobile requires a validation code being held by the PLC which is queried on each connection This password must be stored in your PLC as a 16 bit hexadecimal value 0 to FFFF and must match the value specified in Valida tion Code for connections to that PLC to succeed In most cases this security measure alone is enough for simple applications Validation Codes are stored in PLCs in the following Memory Address or Tag depending on protocol SS IA I TION TAG EIP Native SMValidationTag Any IN
21. for 16 bit values 3 word_swap true byte_swap false will give CDAB for 32 bit values and AB for 16 bit values 4 word_swap true byte_swap true will give DCBA for 32 bit values and BA for 16 bit values str_byte_swap is only attended in combination with the CHAR or STRING data type It provides a way to swap odd and even bytes on character strings without affecting behavior for numeric data types NOTE These attributes are only meant for Modbus communications and are ignored for the rest of supported protocols pag 32 86 www sweetwilliamsl com sweetwilliam ScadaMobile Global Attributes for Allen Bradley controllers Allen Bradley ControlLogix controllers can be plugged in any slot on the backplane Ethernet IP messages can be sent connec ted or unconnected The following attributes can be used to determine these characteristics These are global attributes controller_slot number Identifies the slot where the Logix controller is located Default value is O It is ig nored for EIP PCCC communications SLC and Micrologix connected_mode number When true ScadaMobile will use connected messaging instead of the default boolean unconnected messaging for retrieving data from Ethernet IP enabled PLCs Look below for a discussion on what possible effects you might expect Default value is false ScadaMobile currently supports two EIP mechanisms to send commands to AB PLCs 1 For a
22. precision gt specifier Where specifier is the most significant one and defines the type and the interpretation of the value of the corresponding argu ment lt and gt denote optional fields Note that the string provided for the format tag attribute or the format string passed to the to_s method have a slightly different purpose and may have less available options The following format conversion specifiers are available SPECIFIER Description support support support Binary integer YES YES YES emme e e CECCO semen eee e a emm TT e few e e e 5 eem Se For the meaning and possible contents of the optional flags width and precision fields refer to the sprintf specification http Awww cplusplus com reference clibrary cstdio sprintt Note that since there is no need for it the ength field is not available neither in Ruby or ScadaMobile pag 52 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 11 6 The if then else clause and the ternary conditional operator Two forms of conditional execution are provided 1 The ternary conditional operator provide conditional execution of expressions lts syntax is the following expr exprl expr2 Returns expr if expris not zero true or expr2 otherwise 2 The if then else clause provide conditional choice of expressions It is used as follows 1f expr then expr1 else expr2 end Executes expr1 if expris not zero true If expris zero false
23. pump Min_Level REAL D6 Work ord 2030 section WATER TANK label Low Level Set Point L comment Level at which pumps Valve_i_open BOOL W21 00 Work ord 3000 section VALVE 1 label Open comment Valve 1 Completelly Open access 3 ord 3010 section VALVE 1 Valve_1_failed Boo w21 02 ord Valve_1_cosed BOOL W21 01 Work 2 Export variables in a Reusable symbols file with cxr extension 3020 section VALVE 1 label Failed comment Valve 1 Fail state access 3 label Closed comment Valve 1 Completelly Closed access 3 To do this select Reusable File gt Save AS on the mouse right aei mode Goo 1 00 work ord 3030 section VALVE 1 label Man Auto comment Manual Open wil stop proc V jace Pumpi Fow ReaL 12 i label Input Flow 1 L s comment Current Input Flow SS label Running comment Pump 1 Run state acce cl ick men u over the selected sym bols poo vid eo musei Insert Symbol i label Failed comment Pump 1 Fail state aco Pump_1_mode BOOL H1 01 Auto comment Manual Run will stop pr SS Valve_2 open BOOL W22 00 Validate Symbols ALVE 2 n comment 2 Completelly Open i BOOL w22 01 LV 3 a Valve_2 failed BOOL won Ji Large icons E Pump_2_Flow ER SE List gt EPS O POOL Ci sed comment re 2 Co
24. the best advice is to do some planning follow ing the above recommendations even before implementing your project Then profile periodically for performance as you add more rows to it pag 74 86 www sweetwilliamsl com weetwilliam ScadaMobile 12 Examples The ScadaMobile application comes with pre installed examples that can be used directly or can be downloaded to a PC to be used as templates for your own development The provided examples are the following EXAMPLE WITH PROTOCOL CATION STYLES ALARMS PRES CACCIATA LIECILI omer ene amor nee oo e re o tee wo no nono a O oe mee SCI CECI stein wet roy no eR CECI nmpeeioe ti emer W W meo tmp it nem no mo oo nO CECI CAS CICALE TETI O CIELO StylesExampleModb csv MS Excel ModbusTcr no ves no NO COC E nemo iti semo no ves e o em pcom memon epee no ves me ro antennae men aene o oe ore ve ColorfulControlsEIP_PCCC csv MS Excel EIP PCCC Aphorism ONE csv MS Excel none pag 75 86 www sweetwilliamsl com sweetwilliam ScadaMobile QuickInOut csv This example displays Inputs in channel 0 and Outputs in channel 1 for supported Omron PLCs No special settings or program installed in the PLC are needed This file was created in Excel DataTypes cxr Similar to the previous one but acting on internal PLC areas This serves the purpose of showing the supported data types It can be imported directly into
25. the time string 3661 s OR 0000000000000000 XOR 0000000000000000 al X all sull movistar gt 14 25 E aillmovistar gt 14 26 A Example 8 4 Example 10 Scanner 14 25 al Example 7 ScadaMobile ONE U _RGB Color _Input Values A 7 0 _R Value FF l rr a TT G Value 80 B l soa ee gt _ _ eee PFTm mm gt B Value 00 Select A or B w Slide Values and Select A or B as Blink OFF _ Results Select Blink state Colored Values Color Code hex Colored Color by Name Color Name Enter Color Name Blink Select Blink state pag 83 86 Ternary Operator This is Always Updated 50 0 If Clause FF8000 This is Updated on Selection Change 50 0 COLORED TEXT Green OFF You Just Scanned ScadaMobile ONE THANK YOU FOR SCANNING ME www sweetwilliamsl com sweetwilliam International ONE txt ScadaMobile Demonstrates the use of International Languages in Text attributes and String expressions This file was written in a text editor and saved as Unicode UTF 16 text format The example is self contained and works using only INTERNAL tags pag 84 86 nil movistar 14 20 my PT gt sweetwilliam fa a L ces Oe ERRIA AZ RREA FAR 8 gt MexAayHapogHbil npumep gt International Example IIL Y F LRR Japanese www sweetwilliamsl com sweetwilliam
26. tool and set the gateway IP Subnet Mask 255 255 255 0 Select Port Speed 100 Mbps gt on the Channel Configuration panel Gateway Adde 192 168 1 1 Current Port Speed 100 Mbps Primary DNS E a Server Address sic ar E Select Duplex Full Duplex bt STR 0 0 0 0 Current Duplex Full Duplex Changes to Port Speed and Enable Bootp Duplex require module reset f Enable DHCP DHCP must be configured to return a fixed address V Enable DNS f Auto Negotiate Port Speed and Duplex Refresh __ sa Status Running Cancel Help For Modbus TCP based devices or Siemens S7 controllers refer to the vendor s documentation Now log into the GPRS or DSL Router and configure NAT options to set up a bridge between the WAN and your PLC local address and port Note that the default port number is 44818 for Ethetnet IP 502 for Modbus TCP and 9600 for Omron PLCs Protocol on the router must be set to TCP IP Look at your router documentation for details 6 If you have a fixed IP address enter it as such in ScadaMobile either as a Settings default or embedded in Source Files 7 lf your router access the WAN through a dynamic IP then you must create an account with a dynamic DNS services provider such as www dyndns org and configure your router to notify of IP changes In this case enter in ScadaMobile the name you chose for your dynamic DNS The port number must still be the one configured in the NAT section of
27. type or paste the expression examples in this manual on any of the mentioned tools and see whether they give the expected results pag 41 86 www sweetwilliamsl com sweetwilliam ScadaMobile Values used in expressions or assigned to tag attributes using expressions are represented in engineering units ScadaMobile do not have a notion of PLC raw values except for writing or reading values from PLCs This is important in order to understand why assigning a value to an INTERNAL tag may not give the same result than writing it to a PLC tag and reading it back Dif ferences are due to the implicit scaling descaling and type conversion performed on PLC tags See the value attribute descrip tion for a discussion on this subject When using expressions in your project you must know the following Tag names in expressions are case sensitive This means that a tag named int value will not be the same as a tag named Int value Logical or Comparison operators assume non zero values to be true and zero values to be false The result of a Logical or Comparison operator however is always a value of 0 or 1 Comparison operators are non associative This means that expressions such as value a lt b lt c are not valid You must use value a lt b amp amp b lt c instead Assignments in expressions are not supported except for assigning values to attributes Therefore expressions such as value condition amp amp int tag 3 will cause
28. values that are uniquely defined in the PLC Any attempt to so so will result in a type mismatch error on the offending tag For EIP Native symbolic names any valid reference to an existing scalar or array type tag including structure members or array elements is allowed For example myStructData 2 3 intMember may refer to an integer value referenced by the intMember member of element 2 3 of an array of structures Look at EIP_TAG_Examples csv template for more examples of how to specify tag names for Allen Bradley Logix controllers As a general rule any Tag name path referring to an existing scalar value BOOL SINT INT DINT REAL STRING or array of such elements in a Logix Controller can be accessed by ScadaMobile To access arrays as a whole you need to define an array size next to the type as discussed on the previous and following sec tions You can also access program tags by using the following syntax Program lt program_name gt lt tag_name gt Note that Program is literal lt program_name gt and lt tag_name gt identify just what they suggest Note also that ScadaMobile performs a Validation Code security check before any other attempt to access other tags is made therefore it is mandatory to have a tag named SMValidationCode of type INT in your PLC for communications to work see Validation Codes pag 19 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 3 1 Internal Tags
29. your router iPod 9 55 Remote Port 9600 Modbus TCP defaults Local Port 502 Remote Port 502 B Default Connection Address 192 168 1 34 Host mydns dyndns org B Enable SSL ON Settings pag 69 86 www sweetwilliamsl com sweetwilliam ScadaMobile 9 Security ScadaMobile networking security is based on TCP IP technology and depends in part on the security features available in the router installed at the PLC location For local connections through WiFi security is given by the wireless network security protocol in use WPA and WPA2 with a strong password is the recommended security protocol For remote connections an iPhone or iPod touch is able to make use of secure data tunnels by enabling VPN If your router supports L2TP IPSEC or PPTP then you will be able to create this kind of connection Most medium to high end DSL or Cable routers support at least PPTP VPNs client connections are configured on the iPhone with the General Settings App Some routers can be loaded with a SSL certificate and be configured to bridge incoming SSL requests from the WAN to unen crypted TCP on the LAN side ScadaMobile supports TLS SSL encryption You can activate TLS SSL in ScadaMobile to provide communications confidentiality if your router supports SSL TCP bridging For most protocols ScadaMobile provides an independent way to protect users from undesired access by persons using uncon trolled ScadaMobile copies This is
30. 0 000 000 000 192 168 001 001 de Port No 0 pa 0 Defauit 21 TransferUnitto PC TransferfPCto Uni Compare Sofisw Restat Set Defaults Cancelar For EIP Native protocol and Allen Bradley IMI Module Properties Controller 1 1769 L32E Ethernet Port 15 3 controllers use RS Logix 5000 tool to set a fixed local IP for the PLC on the ethernet module properties panel IP Address 192 168 1 39 Domain Name Must Match IP Address ome sat lane Subnet Mask 259 255 255 0 Select Port Speed 100 Mbps l Gateway Address 192 168 1 1 Current Fort Speed 100 Mbps Primary DNS 1 Full Duplex Done ie 0O0 0 0 0 Select Duplex Full Duplex Secondary DNS a a 0 0 0 0 Current Duplex Full Duplex Changes to Port Speed and For EIP PCCC protocol use Allen Bradley s RS Logix 500 tool and set a fixed local IP for the PLC on the Channel Configuration panel Enable Bootp Duplex require module reset Enable DHCP DHCP must be configured to return a fixed address V Enable DNS F Auto Negotiate Port Speed and Duplex Refresh Set Status Running Cancel Help For PLCs or devices based on the Modbus TCP protocol or Siemens ISO_TCP consult the relevant vendor documentation to know how to set ports and addresses pag 66 86 www sweetwilliamsl com sweetwilliam ScadaMobile 7 2 ScadaMobile Settings for local PLC access ScadaMobile configuration depen
31. 1 testTag REAL 2 HR1 Array element 0 testTag 0 will contain the REAL value at HR1 HR2 Array element 1 testTag 1 will contain the REAL value at HR3 HRA 5 Accessing individual bits of regular PLC memory valid on all protocols BOOL SINT INT DINT REAL in column B HRx y in column C The variable in column A gets the value of bit y 0 or 1 of HRx regardless of its type For writes using this pattern guarantees that writes of individual bits on registers will not affect or overlap other bits in the same or other registers Example get HR1 0 as DINT testlag DINT HR1 0 testTag will contain 0 or 1 depending on the value in HR1 0 6 Accessing individual bits of PLC memory as an array of boolean values valid on all protocols BOOLI n in column B HRx in column C The variable in column A will be an array containing n elements of type BOOL The array gets its values starting from Bit zero of HRx taking the necessary following registers to complete all its data Note that writing BOOL arrays with a size that is not a multiple of the raw register size on PLC memory will cause the exceeding bits to be set to zero Example array of 32 BOOL starting at HR1 testlag BOOL 32 HR1 Array element 0 testTag 0 will contain bit 0 of HR1 Array element 1 testTag 1 will contain bit 1 of HA7 Array element 16 testTag 16 will contain bit 0 of HR2 Array element 31 testTag 31 will contain bit 15 of HR2 Not
32. 16 PM ScadaMobile and a PC using the http link provided below DataTypesModbus csv 2 1 KB 3 9 10 11 16 PM DataTypesModbusES csv 2 1 KB 3 9 10 11 16 PM DataTypesModbusWSource csv 2 6 KB 3 9 10 11 16 PM Apple s Bonjour technology is supported for Safari browser cn I Note while the server is ON the device will never be put into sleep mode DataTypesModbusWSourceES csv 2 6 KB 3 9 10 11 16 PM EIP_TAG Examples csv 1 3 KB 3 9 10 11 16 PM EIP_TAG_ExamplesES csv 1 3 KB 3 9 10 11 16 PM FillATank cxr 7 3 KB 3 9 10 11 16 PM FillATankWSource cxr 7 4 KB 3 9 10 11 16 PM PagesExampleEIP csv 5 9 KB 3 9 10 11 16 PM PagesExampleEIPES csv 5 9 KB 3 9 10 11 16 PM PagesExampleModbus csv 5 9 KB 3 9 10 11 16 PM PagesExampleModbusES csv 5 9 KB 3 9 10 11 16 PM QuickinOut csv 1 7 KB 3 9 10 11 16 PM http 192 168 1 45 8080 s QuickinOutES csv 1 7 KB 3 9 10 11 16 PM Bonjour Ordenador de JOAN 6 StylesExampleModb csv 6 3 KB 3 9 10 11 16 PM 5 AO ew File Upload PC gt ScadaMobile File Server Click on the button below and chose a file from your PC to transfer it to your iPhone or iPod touch If you need to commit changes on the file you just uploaded use the Re submit File button after saving in Excel O 4 1 Source Files supported by ScadaMobile ScadaMobile supports the following source file formats for import vV csv generated by Excel or Open Office V txt any text file with tab comma or semicolon field
33. 2 13 67 1000 223 iPod 21 51 A Tags indx_var 1 3 2 TAG INT struct var memberi TAG INT struct _var realMember TAG REAL struct _var boolMember TAG BOOL e struct_var indxMember 0 TAG INT struct_var indxMember 1 TAG INT struct_var indxMember 2 TAG INT struct_var indxMember 3 TAG INT indx_struct_var 3 memb TAG INT 31 32 2 71828 OFF 35 36 37 38 39 www sweetwilliamsl com sweetwilliam EIP_PCCC_Examples csv The purpose of this example is to demonstrate a set of valid symbolic tag names while accessing Allen Bradley Micrologix con trollers PagesExampleModbus csv This example shows how to arrange tags in several pages It uses arbitrary Modbus Coils and Registers pag 78 86 iPod 21 55 Overview Valve Control B gt Process Data O gt Status Data iPod 22 11 4 Process Data a se e n n 7 A ga a g a E at TIT s E Ema Sn ScadaMobile Pump 1 Current Pressure Pump 2 Current Pressure O _ 7 i i lialele leele ahs go ae Ae l inno Nee La nno SO _ Pump 1 Bearings Temperature Pump 2 Bearings Temperature 40 2 39 7 www sweetwilliamsl com sweetwilliam StylesExampleModb csv ScadaMobile This example shows the available styles and some related tag attributes such as scale format bounds p
34. 4 75 85 www sweetwilliamsl com sweetwilliam ScadaMobile I General Aspects ScadaMobile is presented in a tabbed interface Every tab has its own role within the app and allows for different functions With ScadaMobile you can monitor data coming from various PLCs Generally you will use Settings File Server Files and Connections tabs during deploying stages The Home tab shows real time values of process variables in PLCs or calculated values It is the one you will use for normal monitoring ScadaMobile automatically goes to this tab on launch ScadaMobile uses the concept of Data Sources see Data Sources and Connections see Connections to do its job Sources contain the definition of tags and variables and Connections represent links with PLCs A Source is always associ ated with a Connection but a single Connection can belong to several Sources ScadaMobile also supports user accounts with access levels that can limit the ability to perform certain operations I I Supported protocols ScadaMobile gets values from Industrial PLCs by polling them using TCP IP industrial protocols The following protocols are supported Pit CASCO NP 4 19 t Not exhaustive l EIP Native Allen Bradley ControlLogix and Native CIP communications using Ethernet IP explicit messag CompactLogix ing EIP PCCC Allen Bradley SCL505 and Mi PCCC commands DF1 encapsul
35. 8 UDINT 123456789 MEAL fiVLLIN NCUIvVICN REALValue_ReadOnly HR00010 REAL REALValue HR00010 REAL 3 14159 3 14159 iPod 22 32 z NA CIN CRAL Main Run Stop Switch Main Process Start Stop Tfi gt WALTER IAIA Tank Level L Water Tank Current Level Output Flow L s Current Output Flow from Tank 15 4 High Level Set Point L 500 Level at which pumps stop Mid Level Set Point L 350 Level at which pump 1 stops Low Level Set Point L 100 7 Level at which pumps start Y y ee Valve 1 Completely Open Limit Switch Valve 1 Completely Closed Man Auto OFF OFF Manual Open will stop process Ld The provided examples demonstrate several ways for displaying elements on the Home view list iPod 22 44 Writable BOOL Segment_switch Style An Alternate way to switch a bool Default Button Style You can use a button instead Custom Button Style TEXT And add a custom text on it a Z4TI0DIES Me SS See VAIL we Conveyor Motor state Conveyor Moving Conveyor Control RIGHT Push to move Right Conveyor Control LE Push to move Left Engine Start Switch Tap to start stop Engine 760 IEeXI LOOKUP Stylie Everything is OK Human presence detected in the restricted area pag 7 86 iPod 21 36 Scaling Formating Scaled and Formated Value Wot 3 399 kg Bar Style Weight 3 399 kg rr Slid
36. Always returns an array Will return an empty array L on access beyond limits m can not be negative Example one two three four 2 returns one two Example one two three four 3 1 returns two Example one two three four 2 2 returns three four arr arrl Returns a new array built by concatenating the two arrays together Example one two three four returns one two three four arr joinCstr Returns a string created by converting each element of arr to a string using str as a separator Example one two 3 4 joinC returns one two 3 4 arr fetch n d Tries to return the element at position n or returns d if n lies outside the array bounds n must be numeric value representing the element index Negative values of n count from the end of the array d can be any numeric string or array value Example one two three four fetch 0 none returns one Example one two three four fetch 4 none returns none arr length Returns the number of elements in arr Example L one two length results in 2 pag 49 86 www sweetwilliamsl com Built in functions N Description format fmt System methods SYSTEM SM Lookup n SM color r g D SM color str pag 50 86 sweetwilliam ScadaMobile Returns a string in which the list of arguments following fmt is formatted according to
37. GISTER ord 415 section UINT HOLDING REGISTER write_access 9 ord 421 section DINT HOLDING REGISTER ord 422 section DINT HOLDING REGISTER write_access 9 ord 424 section UDINT HOLDING REGISTER HR8 ord 425 section UDINT HOLDING REGISTER write_access 9 HR10 ord 430 section REAL HOLDING REGISTER HR10 ord 431 section REAL HOLDING REGISTER write_access 9 4 4 gt rN DataTypesModbus ET ScadaMobile looks for the following information on each column Column A Variable Name Column B Data Type Column C Variable Address Column D Tag or Global Attributes including Display and Communication Attributes pag 11 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 1 Specification of Variable Names column A Variable names are entered in column A they must begin with a letter and should not contain spaces or special characters They can be just informative if they are not used elsewhere or they can be functional if used as variables in expressions Vari ables can hold numeric values strings or arrays see Expressions Variable names given in column A have a meaning within the ScadaMobile environment but they are not necessarily aliases to actual Tag names in PLCs PLC tags are referred by address or name depending on protocol and given in column C 3 1 1 1 Tag Scope Tags can be defined to have a local or global scope Local variables are identi
38. KIND MEANING page text Text indicating which page the variable belongs to Text values must be written be tween quotation marks for example page FIRST PAGE text Text indicating which section the variable belongs to Text values must be written be tween quotation marks for example section SECTION ONE text Main text in the cell representing a variable If not specified the variable name in col umn A will be used instead text Secondary text in the cell representing a variable If not specified a text comprising the variable address and its type will be displayed instead number Numeric value determining the order in which pages sections and rows are displayed see Pages Sections and Rows below for a further discussion on this attribute number Indicates the minimum access level an user needs to view a variable By default ac cess 9 is set number Indicates the minimum access level an user needs in order to trigger changes write to a process variable value Omitting this attribute forbids any change to the associ ated variable Tags to witch the user is able to write are referred to as Writable Tags on_label expression String Expression Text displayed for a read only boolean variable when its value is 1 string true off_label expression String Expression Text displayed for a read only boolean variable when its value is 0 string false button_label expression String Expression In combination with the but
39. Micrologix or SLC it will send PCCC commands DF 1 embedded in EIP using a direct path 2 For a ControlLogix CompactLogix it will send native CIP commands using a Backpane Slot Number path The Backpa ne defaults to 1 and the Slot number is given in controller_slot ScadaMobile uses CIP Explicit Messages to retrieve and send data from to Ethernet IP enabled PLCs Explicit messages can be sent unconnected or connected Connected messages require a Connection ID which is first asked to the PLC before sending other messages while unconnected messages identify the specific path to the destination in the same message Connected messaging is generally considered to be more reliable than unconnected because it reserves buffer space in the PLC for the message and is therefore less likely to be blocked by other message traffic However if the TCP link between the message originator and the receiver is weak or prone to fail unconnected messaging may be a better choice Wireless spots or carrier networks can easily drop due to lack of coverage or weak signal in these cases connected messaging communications may take longer to reestablish after a fault resulting in less overall reliability and more user perceived delays than unconnected messaging ScadaMobile uses unconnected messaging by default but you can set it to use connected messaging for a source file by setting the connected_mode attribute to true Global Attributes for Siemens S7 control
40. Pages and Sections Page 1 Page 2 Page 3 pag 34 86 www sweetwilliamsl com weetwilliam ScadaMobile 3 1 6 Look up Tables The Look up table feature allows a variable to pick up a text string from a previously entered list based on current variable value and display said text instead of the tag value To have a Row display a look up text instead of the usual value use the style attribute with lookup or picker as value style lookup style picker If you want to show the lockup text alone with no label and centered as shown in the StylesExampleModb example you can set the tag label to an empty text label The actual table is given in additional rows in the CSV file by using special tags of type LOOKUP in column B and by specify ing the related indexes in column C The text written on column D or a comment attribute on the same row will be the Lookup Text The following table is an example of what you would need to write for creating a two entry table with indexes 1 and 2 LOOKUP This is look up table at index 1 entry2 LOOKUP This is the second entry in the table so it will show if a lookup tag value is 2 Lookup indexes on Column C do not need to be ordered or contiguous they can be any number that fits in 16 bits 0 to 65535 Multiple user lookup tables You can specify an access level for entries in column D In such case you must set the lookup text in the comment attribute This allows for hav
41. T value This tag must be present in order for ScadaMobile to communicate Set initially to 0 to avoid having to enter it on Scada Mobile during development stages EIP PCCC Any INT value This tag must be present in order for ScadaMobile to communicate You may have to create a Data File number 98 of type Integer with at least 1 element Fins TCP Omron D19998 Any value from 0000 to FFFF is valid Modbus TCP Not Available See note below Modbus over TCP Siemens ISO_TCP MW998 Any value from 0000 to FFFF The Validation Code feature is not available for Modbus TCP due to the great number of Industrial devices supporting this protocol which makes impractical to establish a general way to implement such feature Validation codes are entered in the relevant fields of ScadaMobile Connections View ScadaMobile will store and remember codes between connections but it will reset them to 0 for connections that changed as a result of sources change iPod 10 05 Connections Communication Monitor Connections started 4 linked 4 failed 0 Connections FINS TCP FillATankWSource cxr gt Validation Code asso Connected to 192 168 1 40 9600 Connections pag 71 86 www sweetwilliamsl com sweetwilliam ScadaMobile Note that ScadaMobile will always perform this security check There is no way to disable or prevent it however you can set a custom validation tag Custom Validation Tag
42. a row showing the current communications state pag 81 86 www sweetwilliamsl com sweetwilliam ScadaMobile Formula ONE csv Shows several aspects and possibilities of using expressions on attributes The example is self contained by using only INTER NAL tags and it does not need an actual PLC connection to run It is structured in pages and fully commented to demonstrate Switching and displaying hiding of rows on the interface based on user selectable style Use of the picker attribute to allow users to retrieve a value based on a picker wheel control Complete or partial removal of rows sections and pages based on simple boolean states Arithmetic and boolean calculations based on tag values Implementation of controls to enable disable particular alarms Use of system variables in expressions to achieve special effects movistar 16 21 a movistar gt 16 16 Yisibie ROWS gelelt ie gt ln vl _ rl ee ll e rl Show Hide Product 0 suli Switched to Winter Period Show Hide Product 1 PRIDE SHOW pala HIDE SHOW Someone Started the Engine Show Hide Product 2 Human presence detected in the 00000 BOOL restricted area Show Hide Product 3 PRIDE SHOW f NE tetra HIDE SHOW Boiler pressure is above limits Show Hide Product 4 00000 BOOL Show Hide Product 5 00000 BOOL Show Hide Product 6 00000 BOOL Show Hide Product 7 00000 BOOL Sho
43. above 50 effectively ena bling coloring for edge conditions For boolean tags the color_bounds attribute has a predetermined value that will al ways make the tag appear in the color color for the On state pag 28 86 www sweetwilliamsl com sweetwilliam ee TAG ATTRIBUTES KIND tint_co value list lor bounds expression boolean blink_bounds value list plot_color special text pag 29 86 ScadaMobile MEANING A two elements list in the form low high where low and high are numeric values de termining the range of values for the tag where the tint color will NOT apply also known as an exclusion range Look at the color_bounds attribute for more informa tion When both tint_color_bounds and color_bounds attributes are specified col or_bounds takes preference over tint_color_bounds However tint_color_bounds still has the chance to act in the range that has been excluded by color_bounds allowing for further color customization based on tag value Combined Examples color_bounds inf 50 tint_color_bounds inf 0 Will display all values above 50 in the color color positive values up to 50 will be displayed in the tint_color color color_bounds 50 50 tint_color_bounds 20 20 Will display all values be low 50 and above 50 in the color color Values from 20 to 20 will be excluded from the tint_color color so the tint color will show for values from 50 to 20 and from 20 to 50 F
44. am ScadaMobile 7 Network Settings for local access ScadaMobile uses wireless TCP IP technology to connect and to communicate with PLCs Direct access from a local network requires both devices to be in the same subnet The PLC acts as the communications server and the iPhone or iPod Touch is the client The following picture shows a typical setup using the recommended industrial wireless hardware but basically any WiFi router will do it RLXIB4 HN Industrial Hotspot Controllogix __ 1756 ENBT Controller A Switch 4 pag 65 86 www sweetwilliamsl com sweetwilliam ScadaMobile 7 1 PLC Settings for local access In case of Omron s Fins TCP protocol use CX CJ1W ETN21 ETN21Mode Edit Parameters e i tool to set a fixed le IP and Setting FINS TCP DNS SMTP POP Mail Address Mail Send Mail Receive Clock Auto Adjustme 4 gt Port for the PLC on the ethernet configuration FINS UDP Pog FINS TCP Pot NICP P keep alive panel ATASS Defaut E00 Defaut 9600 mi 0 defaut 120 C All 0 4 2BSD C User defin C User defined Baud Rate r FINS UDP Option Auto Destination IP is changed dynamically 10BASE T Destination IP is Not changed dynamically ETN11 compatible mode 255 255 255 0 C IP address table FTP IP Address Table IP Router Table login 00
45. ata O gt Process Data Status Data gt Status Data Alarms Example Alarms Example Imaginary Company Logo pag 61 86 Default Logo gt O gt O gt m gt www sweetwilliamsl com sweetwilliam 5 Connections ScadaMobile Connections represent links between ScadaMobile and PLCs Each Connection can have one or more associated Sources Several Sources are automatically grouped in a single Connection when they share the same communication attributes You can look at Connection states and their associated Sources in the Connections tab view Also Sources information including eventual parsing errors are displayed in it pag 62 86 iPod 9 19 Connections Communication 0 Monitor E Connections started 3 linked 3 failed 0 Connections Modbus TCP z DataTypesModbusWSource gt Connected to 192 168 1 34 502 FINS TCP o Connections iPod reazione Source Info Modbus TCP Protocol Tags 27 Local Host 192 168 1 34 502 Remote Host SSL Enabled No Status Info DataTypesModbusWSource csv remote hostname com 502 o Connections www sweetwilliamsl com sweetwilliam ScadaMobile 6 User Accounts User accounts allows to determine what process variables will be visible or editable for a particular use or user depending on particular variable attributes Relevant attributes for this purpose are
46. ated in Ethernet IP crologix controllers other con trollers through 1761 NET ENI FINS TCP Omron CS1 CJ1 and newest For communication with Omron PLCs with ethernet communi cation capabilities Modbus TCP Schneider Electric Automation For communication with PLCs and RTUs adopting the Modbus Direct Phoenix Contact TCP specification Wago Modbus over TCP Serial Modbus RTU devices Can connect to Modbus devices through a simple Ethernet to Serial gateway Siemens ISO_TCP Siemens Simatic S7 1200 S7 RFC 2126 ISO Transport Service on top of TCP for Siemens 300 S7 400 controllers Step 7 programmable controllers pag 5 86 www sweetwilliamsl com sweetwilliam ScadaMobile 2 User Interface Elements This section provides an overview of the principal aspects of ScadaMobile user interface It does not pretend to be exhaustive Most interface elements will be described as needed in the sections that follow this one 2 1 Tabbed interface ScadaMobile uses the typical iPhone tabbed interface to organize several aspects of the app On each tab a Navigation inter face is usually presented Not all tabs are available to all user accounts and not all the options in a tab are accessible to all us ers Five tabs are available from left to right Settings Available to all users but with restrained options for non Administrator users You can create accounts log to a particular ac count set several user interface behaviors and s
47. ation of Variable Addreses Added section Internal Tags Replaced all previous references to Local tags by Internal tags e Replaced all previous references to arrays by value lists and text strings by text Added section PLC Memory Arrays New bool barcode and validation_tag attributes or styles added to the Tag Attributes section Changed placement of sections Comments in Data Sources and Specification of Communication Protocol Extended section Expressions to cover Strings and Arrays Extended and renamed section Supported Operators and Operator Precedence Added section Data types in Expressions extending and replacing some subheadings in the old Expressions section Updated section System Variables Added section Functions Methods and more about Operators Added section Putting it all together Advanced Expressions Examples Added chapter Performance Added Document Revision History pag 85 86 www sweetwilliamsl com A lt gt We ectwittiam ScadaMobile SweetWilliam S L Contact Information SweetWilliam S L Llevant 10 17844 Cornell del Terri Spain Tel 34 972 59 51 39 e mail support sweetwilliamsl com Web http www sweetwilliamsl com pag 86 86 www sweetwilliamsl com
48. ayed in this tab pag 6 86 www sweetwilliamsl com sweetwilliam 2 2 Variables in ScadaMobile ScadaMobile Process variables or Tag values coming from PLCs are organized in ScadaMobile as a list with sections in a similar way than the Contacts Application Depending on variable type style and other characteristics specific display may vary On the left side of each row relevant information for identifying variables such as their name or their particular role in the moni tored process is displayed On the right side real time values of variables or suitable controls for interacting with them are shown wall movistar gt 21 09 a aj Tags NA CIN CRAL Main Run Stop Switch Main Process Start Stop VV lt A WAICNA IAIA Tank Level L Water Tank Current Level 346 558 Output Flow L s 15 4 Current Output Flow from Tank High Level Set Point L 500 Level at which pumps stop Mid Level Set Point L 350 Level at which pump 1 stops Low Level Set Point L 100 7 Level at which pumps start Limit Switch Valve 1 Completely Open iPod 21 28 A Tags INT HOLDING REGISTER HR00005 UINT UINTValue HR00005 UINT 12345 R ni sa DINI FIVLLING ARCGISICN DINTValue_ReadOnly HR00006 DINT 987654321 DINTValue HR00006 DINT 987654321 DI I RC Li UL IIN IVG Age n UDINTValue_ReadOnly HR00008 UDINT 123456789 UDINTValue HR0000
49. become active when its value is below 0 or above 100 To support simple min or max condition alarms the special numeric values inf and inf can be used see Attribute Scope and Kind for a discussion on these values For example style alarm bounds inf 100 will make the alarm to trigger only when the value on the tag is above 100 The default value for the bounds attribute on alarm tags is bounds 0 0 Therefore any non zero value in a tag will trigger an alarm This is specially relevant for BOOL tag alarms because by default they will become active when the tag goes to 1 true and inactive otherwise just as you would expect Example The following rows on a source file represent the settings for the alarm tags that generated first and forth rows on the screen shot in this page Alarmi INT HR1 label Group 1 comment Weight Value went above 6 kg style alarm bounds inf 6 Alarm4 BOOL C1 label Group 2 comment Someone Manipulated the Switch style alarm Performance Considerations Unless regular tags alarm tags are continuously polled from PLCs even if they are not shown on the screen Also ScadaMobile may continue polling them while running in the background So special care should be taken when deciding what tags will be reserved for alarms Particularly it is advisable to group alarms in tags as contiguous as possible and to use boolean alarms over scalar value alarms for as much as possible In protoco
50. cation state of ScadaMobile Possible val ues are the following 0 Communications running with all PLC connections linked 1 Monitor is switched off 2 One or more PLC are not linked or a new connection is in course Partial link state 3 General communications error No communication is established This variable can be used to implement alarms related to PLC reachability or to show hide interface elements depending on PLC availability Name of the currently displayed page Text representation of the current date and time in the following format yyyy MM dd HH mm ss www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 11 4 Functions Methods and more about Operators Methods can be applied to intermediate expressions or variables to perform type conversions or to achieve particular require ments They are like computer language functions that perform particular tasks Not all methods are applicable to all types and their meaning can vary depending on type Methods are invoked by appending a dot method selector operator followed by its name to the variable or subexpression they apply to Operators can also have a different meaning depending on the type of data they are applied to In the following tables we represent the meaning of the applicable operators and methods depending on data type Numeric operators and methods e roe ca num operator num2 Arithmetic comparison logical operators produce the
51. ce of characters written between quotes str n Gets the Unicode representation of the character at index n in str If n is negative indexes start at the last character Generates an error when attempting an out of bounds access Example Hello world returns 72 72 is the Unicode character representation of H Unicode representation of English Language characters fully match the 7 bit standard ASCII char acter representation str n m Substring Returns a substring of str starting at n and continuing for m elements Always returns a string Returns an empty string on out of bounds access m can not be negative Example Hello world 4 results in hello Example Hello world 5 5 results in world Example Hello world 6 5 results in world str other_str Concatenation Example hello world will give hello world strl compari String Comparison son_operator str2 Returns 1 or 0 true or false when comparing two strings for equality or as if they were sorted in a dictionary Example alpha lt beta returns true because beta is after alpha in a dictionary str to_i Parses a strinto an integer value or returns 0 if not possible Example 3 to_i returns 3 Str to 7 Parses a strinto a floating point number or returns 0 if the conversion is not possible Example 3 2 to_f returns 3 2 str to_s Returns str formatted according to fmt if specified or str otherwise Only the s format speci
52. columns containing quotes in it So you will need to add them manually where necessary This is not anything particular to ScadaMobile it is just how CSVs are Double Quoting is particularly relevant for column D of a ScadaMobile Source File because many attributes expect a text string as their value which may be enclosed in quotes When entering attributes in Excel you do not need to take any special care on this However the same file edited in NotePad will reveal the existence of extra quoting that Excel automatically inserts to avoid text conflicts an meet the CSV spec As an example assuming the tag name was main_switch in an Allen Bradley controller the row referred in section 3 1 4 would look this way on a text editor main_switch BOOL main_switch ord 1 section GENERAL label Main Run Stop Switch comment Main Process Start Stop access 3 write_access 5 If you chose to create and edit your files only using a text editor the recommended way is to emulate the TAB SEPARATED CSV format in which commas are replaced by tabs which ScadaMobile also supports Using this format on texts editors is more convenient because it is more readable and you can avoid all the double quoting hassle The row shown above will look as fol lows using TABs as instead of commas as separators main_switch BOOL main_switch ord 1 section GENERAL label Main Run Stop Switch comment Main Process Start Stop access
53. ctly after the equal sign without quotes including the convenience values Examples write_access 3 word_swap true Texts usually represent text labels or fields in the application interface They must be enclosed in quotes only if they contain spaces or the semicolon character but it is advisable to do it always as a rule to maintain readability label Main Run Stop Switch suffix Attributes requiring a Special Text only accept particularly chosen or formed text strings Valid texts vary depending on the particular attribute style bezel format 4 2 Value lists are used in cases where a single numeric value is not enough to provide the information required by the attrib ute The general format is a list of numbers separated by commas and enclosed between and characters scale 0 360 0 100 bounds 0 100 color_bounds inf 50 Expressions are accepted in some attributes to provide extended flexibility Expressions are discussed on a separate sec tion in this manual hidden my_tag true Il my_other_tag false value flow1 flow2 pag 24 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 4 2 Tag Attributes A Tag Attribute is applied to a Tag or Variable at the same row and it exclusively affects to that Tag All attributes are optional and can be specified in any order The following attributes are supported TAG ATTRIBUTES
54. d operators in expressions since these always refer to actual characters and actual character lengths regardless of encoding Of couse if you only use English or ASCII characters with an encoding that is backward compatible with ASCII or you use the Latini encoding only one byte per character will be allocated in your PLC to store strings pag 40 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 11 Expressions Expressions are allowed on several attributes and provide an advanced way to customize various aspects of the interface and behavior of ScadaMobile projects Expressions allow for combining variables with operators and methods to produce custom results Variables are referenced in expressions by using their names as entered in Column A There are also several system variables that can be used for special uses Event Driven Architecture Expressions in ScadaMobile are stored in a compiled form and are executed by an event driven engine The execution engine keeps expression reference information in a way that value changes trigger expression evaluation The engine is not endlessly executing for loops but only change events The expressions engine keeps references to referring expressions to create a tree like network where all expressions have links to other expressions When a PLC tag changes or an user interacts on a control a change event is triggered This event that occurs at some point in the expressions network
55. d successively converted to formatted strings with to_s The resulting individual strings are embedded into an array and then joined by means of the the join method using as separator Given the following two rows x DINT HR1 label Total Seconds t STRING INTERNAL label Time value x 3600 to_s 02d x 3600 60 to_s 02d x 60 to_s 02d join when HR1 holds 3661 which is 3600 seconds 1 hour 60 seconds 1 minute 1 second the second row will display 01 01 01 Instead of using the join method we could have used the format function in a posibly more convenient way Consider the fo llowing value format 02d 02d 02d x 3600 x 3600 60 x 60 in this case the format specifiers in the format string are just replaced with the relevant time values Calculating seconds from a string having the hh mm ss format Just to illustrate what expressions allow to do let s try now to get the original seconds value from a string already in the hh mm ss format To do so we can use the following expression value 3600 t splitC fetch 3 0 to_i 60 t splitC fetch 2 0 to_i t splitC fetch 1 0 to_i In this case we extract separately the hours minutes and seconds as numeric values from the string we multiply them by 3600 60 and 1 respectively and then sum them to get the total number of seconds The extraction of each value from the original string is performed by the split method
56. ddresses column C A Variable Address represents a memory location a register or a Tag in a PLC to which a Variable refers Addresses are speci fied in different ways depending on which communications protocol they belong to Addresses belonging to different protocols can not be mixed in a particular Source File You must use at least one separate Source File for each PLC and Communication Protocol The particular protocol to use can be specified by means of a comment on the first line as described in Specification of Commu nication Protocol This comment may look something like this protocol eip native For protocols based on registers or memory locations Variable Addresses are specified by a prefix referring to the appropriate memory area followed by a numeric value indicating the position in that area Allen Bradley s Ethernet IP for Logix Controllers is based on symbolic names Write PLC Tag symbolic names in Column C The following memory areas and prefixes are supported EIP Native AB Logix Controllers lt symbolic name gt Access by name Actual symbolic PLC tag name See Note on EIP Native Communication Protocol below EIP PCCC AB Micrologix and SLC 5 00 Outputs 11 Inputs Tags are specified by File type File number and Offset in the regular way Individual bits in words can be ac cessed to using the usual slash notation for SCL and Fins TCP Omron Modbus TCP Modbus over TCP pag 17 86 S2 Status
57. ds on whether you have specified communication attributes for Source Files See Specification of Attributes for further information For Sources without communication attributes ScadaMobile uses the default ports and addresses entered into the relevant fields on the settings tab view Write the values you used for the PLC settings iPod 9 55 Settings Remote Port Modbus TCP defaults Local Port 502 Remote Port 502 Default Connection Address 192 168 1 34 Host mydns dyndns org Enable SSL on A re da i Settings pag 67 86 www sweetwilliamsl com sweetwilliam ScadaMobile 8 Network Settings for remote access ScadaMobile is designed to communicate with PLCs without using dedicated servers or any specific software installed on a PC ScadaMobile communicates with PLCs by using industrial protocol commands To establish a remote connection a GPRS or DSL router is needed at the PLC site which will act as a bridge between the LAN Local Network where the PLC is installed and the WWAN or WAN Internet to which a remote iPhone or iPod Touch will have access to This figure shows a standard setup Internet Local Network WAN IP myname dyndns org LOCAL IP 192 168 1 40 LOCAL IP 192 168 1 1 First determine the LOCAL IP address of the GPRS or ADSL router PLCs need to know the router address as it is the gateway to the internet 1 In case of Omron Fins TCP copy the REPRE alia Aa router addre
58. e on EIP Native communication protocol AB Logix controllers Since EIP Native communications rely on symbolic names and type checking is performed on returned data type matching must be observed Basically most of the above patters are applicable in the general way as far as the data type specified in col umn B matches the actual type on the PLC tag This includes strings and arrays of any type From your perspective as integrator you do not need to treat Logix BOOL arrays in a special way as ScadaMobile handles them automatically for you in essence you can either access individual elements by just entering BOOL on column B and the particu lar array element on column C pattern 3 or you can get the complete or part of the array by specifying BOOL n on column B pattern 6 pag 22 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 4 Specification of Attributes column D Process Variables in ScadaMobile are represented in cells The behavior and display of the monitored variables can be configured In order to do so attributes can be set which determine that behavior As an example some of the available attributes are section label and comment 392 561 process va _ riable value comment Sup Current Output Flow from Tank An attribute description in column D of a Source File follow this general pattern attribute value For example a boolean process variable like the one repr
59. ect to obtain truncated values from arithmetic calculations The above statement may change in the future to give support for true integer arithmetic Currently an implicit conversion to an integer type is only performed for bit or bitwise operations on numbers and indexed access to string or array elements In other cases you can use the to_i method to explicitly get the integral part of a numeric value according to your needs Constant numbers can be represented with optional decimal point and a base 10 exponent Additionally hexadecimal and bi nary notations are supported by using the Ox or Ob prefixes The special forms true false inf and inf are supported as well Examples 1 42 decimal representation 1 1666e 2 decimal representation with exponent OxeOaf hexadecimal representation 0b011011101 binary representation true same as 1 false same as 0 inf very big negative number inf very big positive number Strings Strings are arbitrary sequences of characters that are manipulated as a whole Strings can be read from or written to PLCs Several operations can be performed on strings such as concatenate split or substring extraction by using the appropriate op erators or methods String literals are represented enclosed in double quotes Strings are internally encoded in a compatible type usually UTF8 but several encodings are supported for reading writting to PLCs Examples This is a literal string
60. ed back to the en gineering unit As a consequence a tag may end having a slightly different value after that For example a Tag of type INT having scale 0 10 0 1 will become 1 2 when assigning 1 234 to it through a value change Due to the scaling and type conversion process the value in the PLC will be 12 On PLC writes involving STRINGS implicit conversions will also be performed if possible For example the STRING 2 3 will be converted to the number 2 3 upon writing a REAL tag Similarly the number 2 3 will result to the sequence of charac ters 2 3 when writing to a STRING tag For INTERNAL tags no type or scale conversion is performed on the result of the value expressions Internal tags are just given the result of the expression as it evaluates Thus the scale and bounds attributes will have no effect Even the tag type is ignored to the effects of the assignment and the related variable may hold a completely different type The following considerations also apply INTERNAL tags with a value expression evaluating as a constant value will use it as the initial value for the tag Otherwise internal tags will be initialized to zero or an empty string upon initial project launch Writable INTERNAL tags will simulate a write read round on a virtual PLC taking into account tag type scale and bounds attributes with the same effects as a real write read round as described above expression Numeric expres
61. ehost com remote_port number TCP port used for remote connections to this source WAN Internet If it is not speci fied ScadaMobile will use the standard port for the protocol of the current Source File number Specifies whether TLS SSL encryption is required for a remote connection Non zero boolean numeric values are considered true Default value is false special Allows for using a custom validation tag on protocols supporting it A e For EIP NATIVE the validation tag name is always SMValidationTag it can not be changed For EIP PCCC use validation_tag Nx y only N files can be used and the code is stored as an INT default is N98 0 For MODBUS a validation tag is not supported For FINS TCP use validation_tag Dx only DM area can be used and the code is stored as a WORD default is D19998 For EIP NATIVE the validation tag name is always SMValidationTag it can not be changed For SIEMENS ISO_TCP use validation_tag MWx only MW can be used and validation_tag the code is stored as a WORD default is MW998 If no attribute from this group is specified ScadaMobile will dynamically use default values or values from the application Settings tab view pag 31 86 www sweetwilliamsl com sweetwilliam ScadaMobile Global Attributes for Modbus devices The Modbus specification does not exactly define how the data should be stored in registers or in which order the bytes or
62. epresentations pag 15 86 www sweetwilliamsl com sweetwilliam ScadaMobile Important note about Strings with Siemens Simatic S7 controllers The size field for STRINGS in S7 must be generally specified This is usually done in Siemens software by appending the size in square brackets just after STRING For example STRING 20 However ScadaMobile already uses square brackets to identify arrays so this notation conflicts with S7 notation To work around this we chose to use normal parentheses to indicate size Thus STRING sizes must be indicated in column B using round parentheses The square notation is still reserved for arrays so when you use them you will be referring to ARRAYs Consider the following cases STRING 20 This refers to a STRING with a capacity of 20 characters and should not be confused by STRING 20 STRING 20 3 This is an ARRAY of 3 elements each element is a string with a capacity of 20 characters STRING 20 This is an ARRAY of 20 STRINGs This is not a string of 20 characters Since the default string size for S7 is 254 256 bytes including the size and length fields you will end having an array of 20 STRINGs with a capacity of 254 characters each Actually you will end reading or writing a range of 20 256 5120 bytes on your PLC for this tag and your PLC will most probably reply with an out of range error pag 16 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 3 Specification of Variable A
63. er Style 3399 g e Format in Writable Value Writable value with bezel and format Writable Value Writable value with no style Default Style Values are displayed this way with no style Default Style REAL value A real value with no style Bezel Style Writable value with bezel style 3 399 kg 3399 3399 35 0534 35 0534 AN Home Output Flow L s Current Output Flow from Tank High Level Set Point L Level at which pumps stop Mid Level Set Point L Level at which pump 1 stops Low Level Set Point L Level at which pumps start www sweetwilliamsl com sweetwilliam 2 3 Home Tab Bar and Navigation Bar ScadaMobile The Home Tab is where variables are displayed and where users can interact with their PLC values Like most iPhone produc tivity apps the interface consists on a Navigation Bar on top and the Tab bar at the bottom of the screen The standard iPhone status bar is always visible in ScadaMobile Navigation Bar Tab Bar rocess Data pa Current Pressure Pump 2 Current Pressure Main Run Stop Switch Main Process Start Stop on E Bearings Temperature Pump 2 Bearings Temperature Tab Bar and Navigation Bar Tank Level L Water Tank Current Level Output Flow L s Current Output Flow from Tank High Level Set Point L Level at which pumps stop Mid Level Set Point L Level at which pump
64. esented in the first cell on the figure above could have the following attribute description ord 1 section GENERAL label Main Run Stop Switch comment Main Process Start Stop access 3 write_access 5 The way the first cell on the figure is displayed implies that the current user has an access level of 5 or above because a se lectable switch is available to change the process variable value instead of a static text see User Accounts pag 23 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 4 1 Attribute Scope and Kind Attributes by Scope Most attributes apply to a single Tag or Variable They are referred to as Tag Attributes Others have a global scope within a Source File and we refer to them as Global Attributes In the following sections all attributes are discussed individually Attributes by Kind Attributes can hold a Numeric Value a Text a Special Text or a List of Values depending on their meaning or purpose For some attributes Expressions which calculate values depending on other variable values can be specified Numeric Values are expressed as decimal numbers with optional decimal point and decimal digits if they have sense for the attribute Several special values are provided for convenience Particularly true equals to 1 0 false equals to 0 0 inf represents a very big negative number inf represents a very big positive number Numeric values are expressed dire
65. expected results Available operators are listed on the operators precedence table shown earlier The bitwise and complement operators ex tract the integral part of the operands before computing the result Example 2 2 returns 4 Returns bit n from the integral part of num Bit O is the least significant bit The result can be only 0 or 1 Example 3 0 returns 1 Example 3 1 returns 1 Example 3 2 returns num to_1 Returns the integral part of num Example 3 666 to_1 returns 3 num to_f Returns num num to_s Returns a string representation of num optionally formatted according to fmt For a description of num to_sCfmt possible format specifiers refer to the format function Example 3 666 to_sC 2d results in 03 Example 3 666 to_sC 02f results in 04 Example 3 666 to_s results in 3 666 Example 25 to_s 02 1f C results in 25 0 C Note that specifying a format in to_s is not a standard feature of Ruby num chr Returns a string containing a single character represented by the Unicode character code num Example 72 chr would return H num abs Returns the absolute value of num Example 3 66 abs would return 3 66 num round Returns num rounded to the nearest integer Example 3 66 round would return 4 pag 47 86 www sweetwilliamsl com sweetwilliam ScadaMobile String operators and methods STRING Description Creates and returns a string containing the sequen
66. fied as per the general specification of variable names that is beginning with a letter Global variables are identified by placing a sign before their actual name Examples local_var global_var Local variables have a scope limited to the data source file they are in When a local name is found in an expression its defini tion i looked for only in the same file the expression appears therefore you can use the same names and expressions in several source files without conflicts Global variables have an application wide scope so you can only have single instances of them across all selected source files The advantage of using them is that you can access to their values from anywhere in your project even if the project is made of several source files pag 12 86 www sweetwilliamsl com weetwilliam ScadaMobile 3 1 2 Specification of Variable Types column B Data types determine mostly how variables will be displayed Non boolean Scalar Types can be represented on screen in vari ous ways such as a number a slider control or a progress bar Boolean values can be displayed in several formats depending on attributes Arrays of values can also be stored in variables and transferred from to PLCs By properly using array expressions you can re trieve individual values as desired To indicate that a variable holds an array you append n to its data type In such case n in dicates the total number of elements that the array wil
67. fier is str to_s fmt relevant for strings Example World to_s Hello s would give Hello World str split str2 Creates an array of strings by splitting str using str2 as a delimiter but not including it If str2 is an str split empty string it splits str into each one of its characters If str2 is not given it returns str embedded in an array Example 03 04 2014 spLitC returns 08 04 2014 Example 08 04 2014 splitC returns 0 8 0 4 2 0 1 4 Example 03 04 2014 split returns 03 04 2014 str length Returns the number of characters in str Example Hello Llength returns 5 pag 48 86 www sweetwilliamsl com sweetwilliam ScadaMobile Array operators and methods ARRAY Description Embeds the elements d1 d2 and so on in an array and returns it Array elements can be numbers strings or other arrays Example the following expression 1 two 10 eleven would create an array containing three elements having a number at position 0 a string at position 1 and a two elements array at position 2 arr n Get element at index n from arr If n is negative indexes start at the last character Generates an error when attempting an on out of bounds access Example one two three four 1 returns one Example one two three four 1 returns four arr n m Subarray Returns a subarray of arr starting at n and continuing for m elements
68. fmt fmtis a Formating specification string Formatting specifications in fmt are essentially the same as those for the sprintf function in the C programming language Conversion specifiers in fmt begin with and are replaced by a formatted string of the corresponding argument A character followed by another will yield the character A list of supported conversion fields is given on the next sec tion Examples format Room Temperature is 4 1f 25 will return the string Room Temperature is 25 0 format 092d 02d 02d hours minutes seconds may return the string 01 15 48 as suming the variables hours minutes and seconds contain the same values format Throughput 4 1f 25 will return the string Throughput 25 0 Description The lookup method provides expressions access to the global Lookup table see section Look up Table for a discussion on lookup tables This method picks the text from the global table at index n and returns it as a string If the table does not have an entry for n returns Example Provided that entry 1 of the lookup table is Entry at index 1 then SM LookupC1 will return the string Entry at index 1 Returns a numeric representation of a color ready for use on the color attribute You can either provide the RGB color coordinates as values ranging from 0 to 255 in r g and b or you can pro vide a string with the color name in str Refer to the col
69. h cxr extension created in this way will be recognized as Sources by ScadaMobile pag 57 86 Valve_1_mode Add to Project sven www sweetwilliamsl com sweetwilliam ScadaMobile 3 3 Rockwell RS Logix 5000 as a Data Source generator Allen Bradley support in ScadaMobile includes the possibility to accept files generated directly from Rockwell Software RS Logix development environment as Data Sources You must follow the following steps 3 3 1 Build a Project in RS Logix 5000 Create or open an already created RS Logix project lf you are a PLC systems integrator or programmer you already know how to do it A description on how to program a PLC is beyond this manual You could need some help from an Allen Bradley integra tor or may ask them to do all the steps for you 3 3 2 Export Controller Tags from RS Logix 5000 Unfortunatelly RS Logix does not provide a way to select and export se Controller Organizer lected tags to a file However it is possible to do a bulk export containing all aa dm een global Controller Tags SI Ain Controller Faul New Tag Ctrl W In RS Logix click Export Tags on the right button menu over Controller Tags Power Up Han l sa l Tasks Monitor Tags RS Logix will generate a special CSV file containing all global tags present in dI dioa Motion Groups Edit Tags the project ua Veri Tag Source files generated in this way can contain attributes as described in c
70. ibute is set to alarm Alarm conditions can be specified with a x r Group 2 Second alarm in group 2 did become active the style attribute in combination with the bounds attribute attached 10 09 17 15 36 to the tag mune me Weight Value went below 3 kg Alarms are tracked and listed on a separate table as shown in the Group 2 ue landscape screenshot next to this section When an alarm condi litri tion is triggered the tag abel attribute is used to display the text on Group 2 Third alarm in group 2 did become active lf 15 35 the left which may refer to an alarm group and the comment at G 2 tribute contains the alarm message displayed on the right eae Second alarm in group 2 did become active a Alarms will remain on the list as long as they remain active or they have not been acknowledged Their current state will be shown by small icons next to the alarm text e Bright Red Alarm Clock icon means active and not acknowledged Dark Red Icon means active and acknowledged C Gray Clock Icon means inactive and not acknowledged For a scalar type variables such as INT or REAL the bounds attribute determines the exclusion range of the alarm condition In other words an alarm styled tag will be considered active if its current value is NOT in the specified range For example con sider the following style alarm bounds 0 100 The tag holding these attributes will be treated as an alarm which will
71. iemens ISO_TCP enforces size identification along with memory area thus some restrictions apply for use of BOOL type on larger sizes In this case you can use the bool style to force presentation to a BOOL type when necessary Accessing individual bits in a Register Individual bits on registers can be accessed by using the BOOL type and by specifying a bit address using the dot or slash notation depending on protocol see table above ScadaMobile will use the appropriate protocol command to avoid overwriting undesired bits on the register On EIP Native you can still use the dot notation to access individual bits on variables but due to strict type checking you must set the correct variable type on column B In order to force ScadaMobile to display such values as bools you can use the bool style pag 18 86 www sweetwilliamsl com sweetwilliam ScadaMobile Note on EIP Native communication protocol AB Logix controllers EIP Native communications do not rely on particular memory locations or positions but on symbolic names With this protocol the user is relieved from the responsibility to assign memory addresses or registers and from the need to take tag sizes into ac count for storage Additionally EIP Native tags carry data information such as type and size which ScadaMobile uses to check against type mismatches on PLC returned values As a result it is not possible to store values that differ in type or size from the
72. ile will be thus ignored if the file was already UTF 16 encoded Explicit Localized encodings 8 bit or multibyte encodings Instead of using UTF 16 you may chose to use one of the 8 bit or multibyte encodings that are commonly used by default on lo calized versions of Windows and Excel To do so follow the next steps Create a source file with Strings on your language using your default localized version of Excel as usual e You must explicitly tell ScadaMobile the right string encoding of your file See below Export the file as usual Excel will use the default encoding for your localization Import the file in ScadaMobile ScadaMobile will use the explicit encoding to open the file pag 38 86 www sweetwilliamsl com sweetwilliam ScadaMobile Setting a Explicit String Encoding To set a explicit String Encoding for your file place the following command embedded in a comment on top of your file encoding lt string_encoding gt For example to set Japanese you can write encoding Japanese Win The following explicit string encodings are supported Description WindowsLatin1 Identifies the ISO Latin 1 encoding ISO 8859 1 This is the default UTF 8 Identifies the Unicode UTF 8 encoding MacRoman Identifies the Mac Roman encoding Used on western localizations of Mac OS Useful when you use diacritic characters Spanish French German the degree simbol but you do not want to export your file as cs
73. ill store them in the relevant variable as an array By subsequently using array expressions you are able to reach the individual array elements when required To deal with PLC arrays ScadaMobile uses several access patterns depending on specified type and actual size of data in the PLC We will use examples based on the modbus protocol to discuss each possible case The same patters will work on all pro tocols for similar types and data sizes The following access patterns are possible 1 Accessing 1 bit data size memory areas as single values modbus coils e BOOL SINT INT DINT in column B e Cx in column C The variable in column A gets the value of Cx 0 or 1 regardless of its type Example get value at C1 as INT testlag INT C1 testTag will contain 0 or 1 depending on the value in C7 2 Accessing 1 bit data size memory areas as an array modbus coils e BOOL n SINT n INT n DINT n in column B e Cx in column C The variable in column A will be an array containing n elements of the specified type Bits in each element will be taken from the PLC memory from the less significative to the most significative Example get array of 2 INTs starting at C1 testTag INT 2 Ci Array element 0 testTag 0 will contain bits from C7 to C76 Array element 1 testTag 1 will contain bits from C17 to C32 Example array of 10 BOOLs starting at C1 testlag BOOL 10 C1 Array element 0 testTag 0 will contain C7 Array element 1
74. ing different texts depending on user level For example consider the following entry1_boss LOOKUP oo access 9 comment Only me will see this message I m the boss entry1_worker LOOKUP access 3 comment will see this with my user level of 3 or more Multiple range lookup tables Lookup styled variables use the engineering unit as the index to the table Therefore you can use the scale attribute for PLC tags to make a lookup styled row to access to particular portions or ranges of the table For example scale 0 10 100 110 will forward any raw value coming from a PLC tag in the range from 0 to 10 to table text entries from 100 to 110 You can use this feature to effectively have several virtual tables simultaneously in use The StylesExampleModb example shows how this concept works Note however that since INTERNAL tags do not perform any value scaling the above technique will not work on them Instead you can use appropriate numerical expressions in the value attribute in order to fetch the desired range from the table Addi tionally the global lookup table is available to expressions with the SM Lookup method pag 35 86 www sweetwilliamsl com A lt We otwilliam ScadaMobile 3 1 7 Alarms til movistar gt 16 02 Acknowledge Alarms An Alarm tag is a special kind of tag that is not displayed in the main tags table An alarm tag is characterized because its style OUP l Weight Value went above 6 kg attr
75. l alarms Wot 7 562 kg Bar Style Weight 7 562 kg _rr __ Slide to trigger alarms 7562 g rr Writable Value Change value to trigger alarms 7 562 kg faTa Alarm 1 Acknowledge Alarms Group 1 Weight Value went above 6 kg Group 2 Second alarm in group 2 did become active Group 1 Weight Value went below 3 kg ka www sweetwilliamsl com TABLE OF CONTENTS I General Aspects I I Supported protocols 2 User Interface Elements 2 1 Tabbed interface 2 2 Variables in ScadaMobile 2 3 Home Tab Bar and Navigation Bar 2 4 Bottom Panel 3 Data Source Files 3 1 Data Sources created in Excel 3 1 1 Specification of Variable Names column A 3 1 1 1 Tag Scope 3 1 2 Specification of Variable Types column B 3 1 2 1 Representation of Character Strings in PLCs 3 1 3 Specification of Variable Addresses column C 3 1 3 1 Internal Tags 3 1 3 2 PLC Memory Arrays 3 1 4 Specification of Attributes column D 3 1 4 1 Attribute Scope and Kind 3 1 4 2 Tag Attributes 3 1 4 3 Global Attributes 3 1 5 Pages Sections Rows and Data Sources 3 1 6 Look up Tables 3 1 7 Alarms 3 1 8 Comments in Data Sources 3 1 9 Specification of Communication Protocol 3 1 10 International Languages Support and String Encodings 3 1 10 1 English and Western European Languages 3 1 10 2 String Encoding for International Languages 3 1 10 3 Use of International Characters in PLC Strings 3 1 11 Expressions 3 1 11 1 Da
76. l hold The following types are supported at lee 771 17 CC FiEHX i BOOL n Value that can adopt one of two states SINT n 8 bits signed integer value 128 127 INT n 16 bits signed integer value 32768 32767 UINT n 16 bits unsigned integer value 0 65535 UINT_BCD n 4 digit BCD value stored in a 16 bit register using 4 bits per digit 0 9999 DINT n 32 bits signed integer value 2147483648 2147483647 UDINT n 32 bits unsigned integer value 0 4294967295 UDINT_BCD n 8 digit BCD value stored in two 16 bit register using 4 bits per digit 0 99999999 REAL n 32 bits floating point value IEEE 754 aprox 1e38 1e38 CHANNEL n Same as UINT WORD n Same as UINT DWORD n Same as UDINT STRING n Type containing a characters string Actual representation depends on protocol for example Allen STRING size n Bradley controllers can hold up to 82 character bytes Siemens S7 controllers require a size specifica tion for strings Notice that size is given between parentheses NOT square brackets Note that STRING n does not indicate a string containing n characters but an array holding n strings with default capacity Particularly do not confuse with CHAR n or STRING n which will hold a single string with a capacity of n bytes By default Strings on controllers are interpreted as per the WINDOWS LATIN1 encoding but other encodings are possible if a Explicit Encoding or a
77. la Specification of attributes If you need to specify attributes for ScadaMobile you can give them in the Description column of the Controller Tags view in Print gt RS Logix This is equivalent to filing column D on an Excel generated Source NOTE Files with CSV extension created by RS Logix as described in this section are structured differently than CSV files created in Excel as described earlier However ScadaMobile will recognize them as well Since RS Logix does not provide a convenient way to select a particular set of Tags before exporting you may need to edit the exported file with Excel or a Text Editor to adapt it to your needs In such case you do not need to change its overall structure and format just eliminate redundant rows and you will be done pag 58 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 4 Editing source files in a text editor Since Source Files created in any of the ways described above are simply CSV files they are essentially text files too so inte grators and advanced users can edit them with any text editor such as WordPad or NotePad at their convenience and save them in plain text format The creation of either CSV or TXT files from scratch in a text editor is also a possibility A consideration that must be made if you chose to use a text editor to create or to edit Source Files is that you must be aware of the Double Quoting that Excel applies to text
78. lers For Siemens S7 controllers you can use the controller_slot to give appropriate rack and slot number ATTRIBUTES KIND MEANING controller slot number Identifies the rack and slot where the S7 controller is located Bits 0 4 of this at tribute value identify the slot number while bits 5 7 identify the rack Default value is 0 pag 33 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 5 Pages Sections Rows and Data Sources Page Section and Ord attributes The ScadaMobile interface for the iPhone and iPod Touch consists on a set of cells or rows representing PLC variable values which in turn are arranged in Pages containing Section headers for groups or rows Variables are optionally assigned a Section and a Page by attaching them the equally named attributes All Variables having ex actly the same Page name will belong and will be added to a page with such name Similarly the Section name attribute will be used to put all variables belonging to the same section under an epigraph with that name A single attribute the ord attribute is used to force Pages Sections and Rows to be placed in specific locations Pages and Sections are arranged according to their first appearance on the Source Files based on global order of all variables This is used to force sections and pages to appear in the desired place Variables without an order number will be considered to lay below or after ordered variab
79. les but they will maintain their relative position as found in the source file How it works First rows from all selected Data Source files are sorted from low to high using their ord attribute As said above variables with no ord attribute are moved to the end of the list always keeping their relative original order As sorting is performed variables ord numbers are used to determine Pages and Sections position order Pages are arranged in position orders determined by the smaller ord number of all variables belonging to each page In other words a particular Page will be shown in the order given by the ord number of the first variable belonging to that page Within each Page Sections are then arranged according to the smaller or first ord number of all variables belonging to that Section and Page Finally variables are placed within their Page and Section according to their ord number Example The following page section ord attributes in a series of tags from two sources will be arranged as shown below Source 1 Source 2 Attributes Attributes TAG A page Page 1 section Section 1 ord 1 TAG D page Page 1 section Section 2 ord 4 TAG B page Page 2 section Section 1 ord 2 TAG E page Page 2 section Section 2 ord 5 TAG C page Page 3 section Section 1 ord 3 TAG F page Page 3 section Section 2 ord 6 Resulting arrangement of tags in
80. ls supporting arrays of BOOL they will be the best choice Observ ing this recommendation will lead to shorter communication patterns and less network overhead than if no special care was taken ultimately improving the end user experience pag 36 86 www sweetwilliamsl com A lt We otwilliam ScadaMobile 3 1 8 Comments in Data Sources You can comment Rows on Source Files for documental purposes or while you are testing your project To do so just start the row with the character Examples These are the lookup table entries for the style selection texts we are using This alarm checks for a value being too high on the statistics page 3 1 9 Specification of Communication Protocol Starting with version 1 5 you can explicitly set the communication protocol on source files instead of having ScadMobile deter mining it by the kind of addresses used in Column C as before This feature has been provided to grant future compatibility with a larger number of communication protocols where some addressing naming conventions could conflict or overlap existing ones To tell the actual communication protocol on a source file you must insert the following comment as the first line protocol lt protocol_string gt As lt protocol_string gt you can use one of the following eip native elp pccc fins tcp modbus tcp slemens 1so_tcp For example to communicate with an Allen Bradley ControlLogix controller you would have the followi
81. mer counter as bi nary on the Properties settings of the PLC before importing this example into CX Programming FillATankWSource cxr Identical to the previous example except that communication attributes are incorporated into the file pag 76 86 www sweetwilliamsl com sweetwilliam DataTypesModbus csv ScadaMobile This serves the purpose of showing the supported data types with a focus on Modbus devices This file was created in MS Excel and does not require any program in the PLC DataTypesModbusWSource csv iPod 21 28 A Tags UINT HOLDING REGISTER HR00005 UINT UINTValue HR00005 UINT DINT HOLDING REGISTER DINTValue_ReadOnly HR00006 DINT DINTValue HR00006 DINT 12345 987654321 987654321 UDINT HOLDING ISTER UDINTValue_ReadOnly HR00008 UDINT UDINTValue HR00008 UDINT 123456789 123456789 HOLDING REGISTER REALValue_ReadOnly HR00010 REAL REALValue HR00010 REAL Equal to previous example but containing communication attributes EIP_TAG_Examples csv 3 14159 3 14159 The purpose of this example is to demonstrate a set of valid symbolic tag names while accessing Allen Bradley Logix control lers TAG BOOL sint_value TAG SINT int_value TAG INT dint _value TAG DINT timer1 PRE TAG DINT timer1 ACC TAG DINT timer1 EN TAG BOOL timer1 TT TAG BOOL timer1 DN TAG BOOL pag 77 86 12
82. mpletelly Close 2 V Man Auto comment Manual Open will stop process acce Z Input Flow 2 L s comment Current Input Flow 2 access Running comment Pump 2 Run state access 3 Pump_2_failed BOOL W22 04 Pump_2_mode BOOL H2 01 db Cut Sim_Output_Flow REAL D16 Copy Sim_Pump_1_Flow REAL D18 Sim_Pump_2_Flow REAL D20 Delete Reusable File gt Properties 399 CTS vesta 3 P_Off oop 2 H Secci n1 CF114 1 Failed comment Pump 2 Fail state access 3 IMP 2 label Man Auto comment Manual Run will stop process access VELOPER label Output Flow L s comment Output Flow for simulation VELOPER label Input Flow 1 L s comment Input Flow 1 for simulation ELOPER label Input Flow 2 L s comment Input Flow 2 for simulation Seccidn3 E Secci n4 3 If you want to perform a bulk export of all symbols used in a par a x Pump_1_mode END Sgt ScadaMobileExample 01 ticular program section you can simply export the whole section Boren 8 Open as a Reusable program file ScadaMobile will be also able to ED rencton Bode E open Mnemonics Goto Rung Step recognize any symbols in this file can ez lite Function Block ladder generation Reusable Fie O H File Move Down Rename v Allow Docking Hide Float In Main Window Properties Files wit
83. ng as the first line on your source file protocol eip native NOTE Protocol Specification in this way will be made obligatory in the future for all protocols so it is recommended for integrators and advanced users to use it on new projects and to set a plan to edit existing source files to conform with it Since version 2 1 you must explicitly indicate protocols eip native and siemens iso_tcp pag 37 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 10 International Languages Support and String Encodings The ScadaMobile iOS app includes localizations for English and Spanish for its user interface interface However International Characters and Strings in any language are fully supported Integrators can therefore chose to present their project interface in any language To represent strings the concept of String Encodings is used String Encodings are international conventions that determine how characters representing particular languages are stored into files and device memory 3 1 10 1 English and Western European Languages By default ScadaMobile assumes source files and Strings to conform to the Windows Latini encoding This is adequate for English and most Western European languages such as German French Spanish Portuguese and many others It does not require any particular setting English and Western European versions of Excel on Windows also use the Latin1 encoding for CSV files On Apple Mac computers you must
84. ocumentation A CX Programmer project may look like this This is the PLC Validation Code for this project MOV 021 Move 102201011220220220242225 ABBA Source word D19998 Destination ABBA Hex 2 2 3 P_Off 2 CF114 KEEP 011 Keep Valve_1_mode ord 1000 section GENERAL label Main Run Stop Switct Bit H1 00 Pump_1_mode H1 01 Valve_2_mode H2 00 Pump_2_mode H2 01 4 P_Off 8 CF114 KEEP 011 Keep Run_Stop Valve_1_mode ord 3030 section VALVE 1 label Man Auto comment H1 00 Bit 0 5 11 CF114 KEEP 011 Keep Run_Stop Pump_1_mode ord 4030 section PUMP 1 label Man Auto comment H1 01 Bit 0 6 14 CF114 KEEP 011 Keep Run_Stop Valve_2_mode ord 5030 section VALVE 2 label Man Auto comment H2 00 Bit w20 00 4 gt pag 56 86 www sweetwilliamsl com sweetwilliam 3 2 2 Generate a Source File with variables from CX programmer ScadaMobile 1 In CX Programmer select the symbols that you want to monitor in ScadaMobile Optionally add display attributes for Scada Mobile in the comments column This is equivalent to filling column D on an Excel generated Source see Specification of at tributes Max_Level REAL D10 Work ord 2010 section WATER TANK label High Level Set Point L comment Level at which pump Mid_Level REAL D8 Work ord 2020 section WATER TANK label Mid Level Set Point L comment Level at which
85. olor will be applied Supported values also include TextDefault BarDefault and DefaultGreen which are the colors used by default on texts bars and boolean tags Examples color red color olive color FF3300 expression Numeric Expression The color attribute used in this way expects a 32 bit integer numeric value containing the RGB color coordinates in the three lower significance bytes with the B value in the least significant byte The method SM color can be used for con venience to generate a color from its RGB coordinates or name special Indicates an alternate color to apply The color_bounds and tint_color_bounds attrib text utes determine color application ranges Look at the color attribute for valid color val ues Example tint_color red color_bounds value list A two elements list in the form low high where low and high are numeric values de termining the range of values for the tag where the color will NOT be applied also known as an exclusion range Examples color_bounds inf 50 This will exclude tag values below 50 from displaying in the color set in the color attribute Therefore tag values will be displayed in the speci fied color when they are above 50 color_bounds 50 50 Tag values from 50 to 50 will be excluded from displaying in the color set in the color attribute Therefore tag values will be displayed in the specified color only when they are below 50 or they are
86. ookup Value group 2 3 Enter value to change third text above Lookup Value group 2 5 Enter value to change forth text above e AF LI I Tipies osea ACI This example shows the available styles and some related tag attributes such as scale format bounds prefix suffix as well as the use of lookup tables using EIP PCCC protocol and will run on a AB Micrologix Controller pag 79 86 www sweetwilliamsl com sweetwilliam AlarmsModbus csv ScadaMobile Demonstrates Alarms management on a Modbus configuration The example includes both alarms based on tag value and dis crete alarms The following screenshots show alarming in the application left picture and an alarm notification from ScadaMo bile while running in the background which happened while browsing the internet in Safari wall movistar 15 38 4 Alarms Example gt eet ee alarms ee i eee Tr Weight Value Linked to several alarms Wot 7 562 kg Bar Style Weight 7 562 kg _ r Slide to trigger alarms 7562 g x SI Writable Value Change value to trigger alarms 7 562 kg fata rl Oe 1 ti Alarm 1 ON Acknowledge Alarms Weight Value went above 6 kg Second alarm in group 2 did become active Weight Value went below 3 kg AlarmsEIP_PCCC csv Identical to the previous one but based on the Ethernet IP PCCC protocol pag 80 86
87. or attribute for further information on avail able colors www sweetwilliamsl com Math methods Math atan2 y x Math cos x Math expCx Math Log x Math Log10Cx Math sinCx Math sqrtCx Math tanCx Math PI pag 51 86 sweetwilliam Description Computes the principal value of the arc tangent of y x using the signs of both arguments to de termine the quadrant of the return value The atan2 function is used mostly to convert from rectangular x y to polar r coordinates that will satisfy x r Math cos and y r Math sin In general conversions to polar coordinates are computed in this way r Math sqrt x x y y 6 Math atan2 y x Computes the cosine of x measured in radians Calculates an exponential function e raised to the power of x Calculates the natural logarithm of x Calculates the base 10 logarithm of x Computes the sine of x measured in radians Computes the non negative square root of x Computes the tangent of x measured in radians Returns the n constant number www sweetwilliamsl com ScadaMobile weetwilliam ScadaMobile 3 1 11 5 The format specifiers and the format function The built in function format returns a string formatted according to a format string like the usual printf conventions of the C lan guage In addition format accepts b for binary ScadaMobile format specifiers adopt the following form lt flags gt lt width gt lt
88. or boolean tags color_bounds and tint_color_bounds have predetermined values You can simply use tint_color to display a color for both Off and On states while color will supersede the color for the On state Numeric Expression Will cause any non writable tag to blink on the interface when the value assigned to the attribute is not zero true A two elements list in the form low high where low and high are numeric values de termining the range of tag values where blinking will NOT be applied If specified on a read only tag the tag will visually blink with a period of 1 second for the values not in the specified range when the expression assigned to the blink attribute is true Example to set a tag to blink always blink_bounds inf inf Example to set a tag to blink when its value goes below 10 or above 10 blink_bounds 10 10 Example to set a boolean tag to blink for the On state blink_bounds 0 0 Determines the color to be used in trend graphs when plotting this tag If omitted a sequential color is chosen automatically www sweetwilliamsl com sweetwilliam ScadaMobile Tag Attributes for Modbus devices Modbus registers can be accessed on a PLC using serial communications through a Modbus RTU to Modbus TCP Ethernet gateway You can specify a slave id when using this feature number This attribute identifies the associated tag as belonging to particular modbus device Particularly modbus
89. ould generate anyway Tags used in alarms or used in expressions are permanently polled to guarantee interface consistency These tags are also candidates to automatic optimization and applied all the above techniques but since they are read more often they offer the best opportunity for integrators to optimize their project in an user noticeable way As said this is by far the best thing you can do to optimize your project The key is to have as few as possible tags tied to expressions and to keep them in contiguous PLC memory addresses specially with no intercalations of tags that are not used in expressions i e tags that are candidates to be stripped off from readings In other words keep the tags used in expressions or alarms as packed as possible in PLC memory and do not interlace them with the remaining tags f you use a lot of boolean tags consider boolean arrays on EIP Native or bit access on registers on other protocols Bit readings on registers are faster because you get several boolean values with a single register read Finally ScadaMobile communications are completely moved to secondary threads and executed asynchronously in order to minimize any impact to the user interface execution This essentially decouples user interface execution from PLC communica tions From a user perspective the app behaves as if only the user interface was running If you are concerned about performance or you are planning a really big project
90. pecify default communication settings Non Administrator users have all options banned except the Log In feature File Server Only available to the Administrator user Allows for managing uploading and downloading files into ScadaMobile through its embedded Web Server Files Only available to the Administrator user Presents a list of source files containing tag definitions and allows for placing a selec tion of the relevant ones for an application You can also store and view any documents or reload the provided examples within this tab Connections Available to all users but with restrained options for non Administrator users Presents a series of entries called connections that represent actual links to PLCs Within each connection you are able to check the communication status and to set valida tion codes for PLCs Also relevant communication settings and error information is presented for sources and connections You can also switch monitoring on or off from this section Non Administrator users are only allowed to switch monitoring on or off from this tab Connections and all related information is hidden for these users Home This is the main view and the place where actual tags variable values and any calculations are presented It is available to all users but access level on tags will be applied depending on the current source files configuration so what each user views may vary Trend graphs and Alarms are also displ
91. pesModbus csv 2 5 KB V tion One or several sources can be selected and variables from all of them will be presented depending on current user access level DataTypesModbusES csv 2 5 KB DataTypesModbusWSou 2 6 KB Each source refers to a single PLC but several sources can refer to the same PLC All sources that point to the same PLC are automatically joined into a single Connection DataTypesModbusWSou 2 6 KB FillATank cxr 7 3 KB FillATankWSource cxr 7 4 KB NOTE Be sure you have at least one selected source or ScadaMobile will not display any variable or row on the Main View pag 10 86 www sweetwilliamsl com sweetwilliam 3 1 Data Sources created in Excel ScadaMobile You can use an Excel or Open Office to compose a data source file for ScadaMobile The file must be exported or saved in CSV format NOTE CSV file format is not identical for all language localizations due to different use of delimiters ScadaMobile accepts any csv files in any of the supported languages but unfortunately this is not the case for MS Excel Consequently Excel may not correctly open the provided examples on the wrong language An Excel spreadsheet with the specification of variables consists of four 4 columns and one row per variable a DataTypesModbus csy B in_BOOLValue BOOL in_BOOLValue2 BOOL BOOLValue ReadOnly BOOL BOOL Value BOOL BOOLValue ReadOnly2 BOOL BOOL Value2 BOOL BOOLValue3 BOOL BOOLValue4 BOOL
92. r nated with a temperature value given in a variable named temp In order to achieve this we enter the following expression in a row value SMPulse10s Time SMDate splitC 1 Temperature temp to_s 3 1f C We use the ternary operator to switch between the time and the temperature depending on the SMPulse10 system pulse vari able For the clock we take SMDate and discard the date portion by splitting it out The temperature is presented formatted with a custom prefix and suffix appended to the actual value We can alternatively use the format function to simplify a bit some portions of the expression value SMPulse10s format Time s SMDate splitC 1 format Temp 3 1f F 9 5 celsius 32 pag 55 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 2 Omron s CX Programmer as a Data Source generator FINS TCP support in ScadaMobile includes the possibility to accept files generated directly from Omron s CX Programmer de velopment environment as Data Sources The steps to follow in this case are presented next 3 2 1 Build a project in CX Programmer If you are a PLC systems integrator or programmer you may already know how to use CX Programmer In this tutorial we pre tend to expose some key steps that you have to know to get your project properly monitored in ScadaMobile However a de tailed description of how a PLC program is made is beyond this manual Please refer to the OMRON d
93. raphs tap on the Navigation Bar right button pag 8 86 www sweetwilliamsl com sweetwilliam ScadaMobile 2 4 Bottom Panel By tapping on the right button on the home view Navigation Bar the bottom panel will appear The various user interface elements in it will allow you to view and acknowledge alarms as well as create any number of trend graphs with any number of plots in them Just scroll the bottom panel left and right to move to different pages on it The page control on the bottom also provides a way to switch among bottom panel pages Scaling Formating l Wgt 1 940 kg Scaled and Formated Value Bar Style Weight 1 940 kg Slider Style 1940 g EEE Format in Writable Value 1 940 kg Writable value with bezel and format Bottom Panel pag 9 86 www sweetwilliamsl com A lt gt We otwilliam ScadaMobile 3 Data Source Files Source Files contain information that ScadaMobile needs for visualizing PLC process vari ables as required by users mil Carrier gt 11 58 AM ScadaMobile accepts csv files created in Excel Open Office or a plain Text Editor For some Undo iles PLC brands it partially supports as well files which are directly created from PLC vendor s de velopment tools such as Omron s CX Programmer or Allen Bradley RSLogix Sources DataTypes cxr 1 9 KB Source Files imported into ScadaMobile are shown in the Files tab under the Sources sec DataTy
94. rce Files are conven iently backed up Restrictions for Non Administrator users Only the administrator account has full access to all the application Non administrator accounts have restricted access to de ployment features and not all tabs are available to them The following screenshots show the available tabs for the Administrator user left and for a regular user right LEVEI di WICH pumps Stari LEVEI di WIICTI pumps start Limit Switch Valve 1 Completely Open OPEN Limit Switch OPEN Valve 1 Completely Open administrator user regular user pag 63 86 www sweetwilliamsl com A gt sweetwilliam ScadaMobile Managing accounts Accounts are managed in a navigation interface similar to the Contacts application The screenshot below shows that a new ac count named Tommy has been created which has an access level of 3 and that it is active all Carrier gt ill Carrier gt 6 12 PM User Settings Settings ccounts Edit Automatic login Default accounts v administrator Manage accounts V nobody Other accounts File Server Vv Tommy Port New account Omron FINS TCP defaults Settings f In order to log in a particular user tap on Current account You can also make ScadaMobile to ask for the current account password at launch In order to do so set the Automatic login switch in Settings to Off pag 64 86 www sweetwilliamsl com sweetwilli
95. refix suffix as well as the use of lookup tables iPod 22 15 a lt Tags iS Enter value to change third text above Lookup Value group 2 5 f Enter value to change forth text above lag Cxampies Weight f mn Enter rate 3399 g a 89 0 nter rate Weight 3 399 kg e Production Rate 89 0 C o Fan Control Selected Fan Speed Fan speed below 25 Speed 24 4 ei i Output Rate 89 0 Average StylesExampleEIP_PCCC csv Just to Change Above Texts vUdidl Values Scaling Formating wot 3 399 kg Scaled and Formated Value Bar Style Weight 3 399 kg Slider Style 3399 g e T __ __ __ _ Format in Writable Value 355 kg Writable value with bezel and format Writable Value Writable value with no style 3399 Default Style Values are displayed this way with no style 3399 Default Style REAL value A real value with no style 35 0534 Bezel Style TEET Writable value with bezel style Aa Home iPod 22 15 LECE ay ele oJ oe OS e U dat Everything is OK Human presence detected in the restricted area This is entry 3 on the second table so it will show if tag value is 3 Second boiler pressuse is above limits a erzialoe z tele e lt gt int rt ln e nnt Aa Lookup Value group 1 0 Enter value to change first text above Lookup Value group 1 4 Enter value to change second text L
96. rge number of tags for the single purpose of showing their PLC value will not incur in any performance penalty because most of the time they will not be polled out from the PLC anyway If a particular PLC address needs to be read at a given time it will only be read once per polling cycle regardless of how many instances of tags tied to that address are found in the project Consequently you can repeat the same PLC tag address as many times as you need in your project without having to worry about any performance penalty The list of candidate tags to be read at a given time is applied a minimal cost algorithm to determine the less and shorter available communication frames for the relevant protocol which fulfill the entire request The optimal solution may include read ing unsolicited tags if this justify a better performance figure The simpler scenario is reading several almost contiguous tags with a small gap in between Reading all of them and then discarding the unused ones may be faster than only reading the so licited ones To help on this you can use tags as contiguous as possible and leave the shorter possible gaps between them however note that if you have spared tags that are used in expressions or your users make extensive use of the plotting feature this measure may not be as effective as you might expect or even unproductive because basically you may not always beat the already optimal set of commands that ScadaMobile w
97. s in single methods instead of implementing all of them So it is important to refer to this manual if you are also using a Ruby tutorial to determine what it is actually supported on ScadaMobile and which behavior differences may apply For those who already used Ruby one of the most obvious differences between pure Ruby and ScadaMobile is treatment of boolean values Ruby treats everything as objects including numbers while ScadaMobile keeps the traditional C like behavior For example in Ruby any number used in a boolean expression is a true value even if it holds zero ScadaMobile on the other hand will still interpret 0 zero as false and non zero as true in the traditional sense of earlier programming languages and hopefully in accordance to what PLC programmers would expect or feel more natural NOTE If you are not familiarized with Ruby and want to test some ScadaMobile expressions before you start using them in your project you can try them on any of the available Ruby interpreters to help you understand how they work e On any Mac OS X or Linux computer open the Terminal and type irb This will launch the interactive Ruby interpreter On the gt gt prompt type or paste any expression you would like to try e Ruby can be installed on Windows as well Refer to this to begin with http Avww ruby lang org en downloads e You can even type Ruby expressions right on your Internet Browser Go here http TryRuby org Just
98. s not allowed at any level on the expressions execution chain For example the following row int value INT INTERNAL value int value 1 is not valid because the int value tag creates a circular reference around the value expression pag 42 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 11 1 Data types in Expressions Variables and Expressions in ScadaMobile support three basic data types Numbers Strings and Arrays Appropriate opera tors and methods allow for conversion among types and to perform custom operations with great flexibility See the following sections for a discussion on methods and operators Mixing Numbers Strings or Arrays is only possible through the use of the appropriate operators and methods that result in com patible types An direct consequence is for instance that you can not concatenate a number to a string unless you convert the number to a string first Also some operators have particular semantics depending on type just as most modern scripting lan guages including Ruby do See next sections for a further discussion on this an other subjects Numeric values Numeric values in expressions and variables are internally stored as Double Float values 64 bits Values read from PLCs in cluding BOOL and INT tags are scaled and converted to Double Float type before they are used in expressions All Arithmetic Logical and Comparison operations are performed as Double Float operations You may never exp
99. s with a capacity of size bytes each See also section Representation of Character Strings in PLCs below LOOKUP This is a special purpose type used to create a text entry on a table which is referred to by variables having the lookup style attribute Rows with the LOOKUP data type on column B are just lookup data table entries and do not have any role on communications or add additional rows on screen See also Lookup Table When specifying the tag type you can optionally define an array size for it as shown above in italics When you do so the related variable will hold an array of values of the relevant type instead of a single value See Memory Arrays for more in formation Size definition is obligatory for CHAR types pag 14 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 2 1 Representation of Character Strings in PLCs Strings in PLCs are stored in several ways depending on PLC brand or family ScadaMobile uses a homogeneous way to indi cate PLC tag types that in some cases differ slightly from the PLC manufacturer way As a general rule you do not generally need to worry about which particular representation a particular PLC uses ScadaMobile handles it all automatically for you However not all PLCs share the same fields for representing a string For example Allen Bradley controller strings are fixed ca pacity and can hold up to 82 character bytes Siemens S7 controllers on the other hand require a size
100. save your CSVs as csv windows format to conform to this encoding The Latini encoding is backward compatible with old plain ASCII meaning that ASCII characters share the same codes when represented in Latini encoding 3 1 10 2 String Encoding for International Languages If you use a language that can not be represented with the Latini encoding you are still able to import your files containing in ternational characters in text attributes Additionally international characters are supported in Strings and they can be written and read back from PLCs without breaking their particular encoding There are two ways for using international characters in ScadaMobile Unicode UTF 16 encoding 16 bit multibyte encoding The UTF 16 encoding is capable for representing any character from virtually any language in the wold To make use of this en coding you can do the following Create a source file with texts in your language using your localized version of Excel as usual Export the file as Unicode UTF 16 text Import the file as usual in ScadaMobile ScadaMobile will automatically detect files encoded as UTF 16 Unicode strings will be converted to UTF 8 before storing them on PLC memory NOTE Strings in source files containing UTF 16 characters will be converted automatically to UTF 8 regardless of the Explicit Encoding specified on the source file as defined in the next sub heading Any Explicit string Encoding given in a source f
101. sent in the PLC and y1 y2 represent the same values in engineering units as will be displayed on ScadaMobile By setting this tag attribute raw values are converted scaled to engineering values on display by applying a lin ear transformation This attribute can be specified in any read only or writable PLC tag See also the value attribute for a discussion on the particular support of this attribute on INTERNAL tags Example scale 0 100 0 1 pag 27 86 www sweetwilliamsl com sweetwilliam ScadaMobile ANT ___________1hhh_ 1 A ZJ5yFrHAIGo AWYWA TAG ATTRIBUTES KIND MEANING value list A two elements list in the form min max where min and max are numeric values used to indicate a range expressed in engineering units This attribute can have sev eral meanings depending on other attributes particularly the style and the write_ac cess attributes On writable tags it determines and limits the available range of values that users will be able to enter On read only tags its meaning depends on the particular style of the tag It is currently supported by the bar slider and alarm styles Example bounds 100 100 special Indicates a color to apply to a variable value or control Colors can be specified by text name as listed in http Wwww w8schools com css css_colornames asp Colors can also be given by RGB value in hexadecimal format The color_bounds attribute de termines when the c
102. serial devices with the specified id that are connected through a TCP gateway will be accessed The default value is 1 Note that the slave_id attribute for Modbus is a Tag attribute so it applies only to the register it is next to This is in contrast to the controller_slot attribute which is global and applies to a source file pag 30 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 4 3 Global Attributes Global Attributes are modifiers that apply to all tags or have a meaning in the context of the whole Source File Global attributes can be placed anywhere in column D of source files So they can be specified next to any variable and they will still have a glo bal scope NOTE If a particular global attribute is included more than once in a source file only its first occurrence will take effect Communication settings are global and therefore they need to be specified only once in a source file ATTRIBUTES KIND MEANING localip text Source address in text format for local access LAN Example 192 168 1 40 local_port number TCP port used for local connections LAN to this source If it is not specified Scada Mobile will use the standard port for the protocol of the current Source File For ex ample 502 for Modbus Note that this can differ from the default port specified in ScadaMobile settings tab remote_host text Source address or symbolic DNS host name for remote connections Example remote remot
103. sion Will make the row hidden when the result of the expression is boolean non zero Hiding all rows in a Section will remove the entire section including the sec tion title Hiding all rows sections on a page will remove that page from the interface Hiding showing interface elements is fully animated and dynamic on evaluation of the hidden expression Dynamic hiding is useful to switch among several rows that se lectively meet an arbitrary condition or to force display parts of the interface depend ing on user or PLC triggered conditions style special Attribute containing one of the texts below determining ways to represent or display text the value of a variable switch It is the default style for writable booleans It displays a boo lean variable using a Switch control The variable will change its state on each touch Will be ignored if the variable is not wri table segment_switch Displays an alternative to the switch style for writable boo leans pag 26 86 www sweetwilliamsl com sweetwilliam ScadaMobile SAI TAG ATTRIBUTES KIND MEANING button Presents a Push Button for writing of boolean values Contrary to the switch style the related process variable does not change permanently but it goes to 1 true on button press and goes to 0 false on button release bezel Draws a bezel line around a text field for highlighting writable numeric values Note that it is only applicable to wri
104. specification for strings For Allen Bradley Controllers you can simply use STRING to indicate a single string or for STRING n to indicate an array of n strings The actual representation of a single string on the PLC consists on a UINT or UDINT field followed by a 82 bytes long buffer AB MICROLOGIX STRING REPRESENTATION STRING Length 2 bytes Characters fixed size 82 bytes AB LOGIX STRING REPRESENTATION STRING Length 4 bytes Characters fixed size 82 bytes For Siemens S7 controllers you must use STRING size where size is the total number of byte characters that the string can hold or STRING size n to indicate an array of n strings of size character capacity The actual representation of a STRING size in the PLC consists on the following pattern SIEMENS SIMATIC S7 STRING REPRESENTATION STRING size Size 1 byte Length 1 byte Characters variable size Although the above representations are the default ones for the mentioned controller brands ScadaMobile will still chose one of them for use on any controller Usually however you will want to use the raw char string representation CHAR n RAW CHAR STRING REPRESENTATION CHARISize Characters variable size For raw char string reads ScadaMobile will understand NULL character or the total buffer size as the termination of the string On writes ScadaMobile will pad all unused bytes with NULL characters This is the usual convention for raw character string r
105. ss in the IP Route Table field of the ethernet configuration panel for the Setting FINS TCP DNS SMTP POP Mai Address Mail Send Mail Receive Clock Auto Adiustme 4 PLC in CX Programmer Broadcast FINS UDP Port FINS TCP Pot TCP IP keep alive CATEI Dama op etna 600 0 min ear AI0 4 2BSD User defined User defined P Address Conversion i Baud Rate FINS UDP Option 192 168 1 40 Auto dynamic Auto Destination IP is changed dynamically Auto Static 10BASE T Destination IP is Not changed dynamically p Subnet Mask Combined ETN11 compatible mode 255 255 255 0 IP address table FTP IP Address Table ire Login 000 000 000 000 192 168 001 001 Password ins Port No o Del 0 Default 21 TrensferlUnitto PC ITransferlPCto Unit Compare Sotsw Restat Set Defaults Cancelar pag 68 86 www sweetwilliamsl com sweetwilliam ScadaMobile For EIP Native protocol and Allen Bradley E Module Properties Controller 1 1769 L32E Ethernet Port 15 3 controllers use RS Logix tool to set the EE EEE ZZZ fixed local router IP gateway on the eth FS ORA ernet module properties panel IP Address 192 168 1 3 Doman Mamo CO For EIP PCCC protocol use Allen Bradley s Must Match IP Address on General T ab Hast Name RS Logix 500
106. ta types in Expressions 3 1 11 2 Supported Operators and Operator precedence 3 1 11 3 System Variables 3 1 11 4 Functions Methods and more about Operators 3 1 11 5 The format specifiers and the format function 3 1 11 6 The if then else clause and the ternary conditional operator 3 1 11 7 Putting it all together Advanced Expressions Examples pag 3 86 We trim ScadaMobile O ON O 34 35 36 37 37 38 38 38 40 41 43 45 46 47 52 53 54 www sweetwilliamsl com 3 2 1 Build a project in CX Programmer 3 3 Rockwell RS Logix 5000 as a Data Source generator 3 3 1 Build a Project in RS Logix 5000 3 3 2 Export Controller Tags from RS Logix 5000 3 4 Editing source files in a text editor 4 File Import into ScadaMobile 4 1 Source Files supported by ScadaMobile 4 2 Other Files supported by ScadaMobile 4 3 Custom Company Logo 5 Connections 6 User Accounts 7 Network Settings for local access 7 1 PLC Settings for local access 7 2 ScadaMobile Settings for local PLC access 8 Network Settings for remote access 9 Security 9 1 Validation Codes 10 Background Task Processing Il Performance 12 Examples Document Revision History pag 4 86 DE trim 3 2 Omron s CX Programmer as a Data Source generator 3 2 2 Generate a Source File with variables from CX programmer ScadaMobile 56 56 57 ee 58 58 a 58 59 60 60 61 61 62 63 65 66 67 68 70 TI 73 7
107. table tags Presents the variable as a boolean even if it is not of type BOOL limiting the possible values to O or 1 It also activates related attributes such as on_label and off_label and brings the special meanings of some attributes for bool types Presents a variable as a slider control or a bar depending on whether it is writable Min and Max values are given with the bounds attribute Both are identical and can be used indis tinctly lookup Displays a text from a lookup table instead of the actual tag value The tag value is used to determine which entry in the table is shown This attribute will work both on read only tags and writable tags On writable tags the bounds attribute is used to determine which range on the lookup table will be made available to the user for selection See Lookup Table picker It is like the lookup style except that it will draw a bezel around the displayed lookup text when used on writable tags alarm Tags with this style are referred to as Alarm Tags and they are not shown on the main table but on the Alarms Panel They can be combined with the bounds attribute See Alarms barcode Activates the barcode reader for this tag The tag must be wri table usually of type STRING After reading a barcode with the device camera the tag will be updated with the scanned code value list A four elements list in the form x1 x2 y1 y2 where x1 x2 represent a pair of numeric values in raw units as pre
108. tation of a counter reset BOOL INTERNAL label Reset Button style Button write_access 0 increment BOOL INTERNAL label Tick Button style Button write_access 0 counter DINT HR1 label Counter value if reset then 0 else if increment then counter 1 The Reset and Tick buttons will provide in this case the interface for a counter value written to the PLC Now consider the following case colori UDINT INTERNAL label Color 1 write_access 0 color2 UDINT INTERNAL label Color 2 write_access 0 colorSelection BOOL INTERNAL label Select Color style Switch write_access 0 coloredValue DINT HR1 label Colored Value color colorSelection colori color2 The coloredValue color will be always updated according to colorSelection after any change of color1 or color2 pag 53 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 11 7 Putting it all together Advanced Expressions Examples Converting an arbitrary number of seconds to hh mm ss format The following expression shows how to get a string in the form hh mm ss from a numeric value containing seconds In this ex ample x contains the total number of seconds to be converted to the desired format value x 3600 to_s 02d x 3600 60 to_s 02d x 60 to_s C 02d joinC The operators and are used to calculate hours minutes seconds as numeric values These are then truncated to integer with the to_i method an
109. ted Operators and Operator precedence The following table shows the available operators and its precedence The table lists all operators from highest precedence to lowest O PERATOR ee ETRE Parentheses grouping from inner to outer I COTTI TT eee e Bitwise XOR Bitwise OR left to right Comparison operators not associative O Treo Operators are used in the usual way as per the Ruby or C language Depending on data types involved the same operator may have a different meaning See Methods Expressions and more about Operators for further information pag 45 86 www sweetwilliamsl com sweetwilliam 3 1 11 3 System Variables ScadaMobile There are a number of system variables that can be used in expressions as if they would be regular tags The following vari ables are provided SMPulse10s SMPulse30s SMPulse60s SMAckButton SMCommState SMCurrentPage Name SMDate pag 46 86 TYPE number read only number read only number read only string read write string read only Description They generate a square wave signal with the period implicit on the variable name They can be used to implement a Keep Alive tag to write periodically a value on a PLC or to trigger periodic events for any purpose Variable linked to the Acknowledge button on the alarms panel Goes to 1 when the button is pushed and 0 when it is released A value indicating the current communi
110. the device to go to sleep if keeping alarms and graphs updated at any time is essential pag 73 86 www sweetwilliamsl com sweetwilliam ScadaMobile ll Performance ScadaMobile is designed to offer great performance and a satisfactory user experience with good interface responsiveness In tegrators do not usually need to take particular actions to improve performance The app carries out a series of optimizations on tags and PLC communications that in most cases are enough to relieve integrators from having to adopt particular actions or design patters Still understanding what optimizations ScadaMobile performs can be useful to find out why if ever a performance issue arose and what you can do to improve on it Performance matters tend to be a complex subject and extensive discussions can be made ultimately testing is the only way to have a trustable answer We will just enumerate some of the techniques used in ScadaMobile to maximize performance and will give some tips to help you getting the best of the app for your particular project ScadaMobile automatically performs the following optimizations Only the minimum set of tags necessary to display the interface is polled at a given time Particularly tags that are not used in expressions and which values are not shown on the interface at a given time are not polled at all Therefore the less tags you link with expressions or use in expressions the better In fact having a la
111. tive impact on battery life When OFF ScadaMobile will close any open connection when another application becomes active or the device goes to the lock state either by the Auto Lock timeout or by pushing the bottom on the edge This will prevent excessive battery drain and may reduce carrier fees in case of cellular remote connections When the device is unlocked and ScadaMobile becomes active again communications with PLCs will be restarted Background process When ON the app will continue running in the background for a finite period of time while other applications are active thus al lowing for keeping alarms and graphs updated and enabling local alarm notifications while the user is performing other tasks When OFF the app will not explicitly start a procedure to run in the background and local notifications will be disabled How ever given how the iPhone iOS behaves the app may still be running in the background for an undetermined period of time if enough resources are available or the user does not explicitly switch to a different app The maximum time applications are allowed to run in the background or in the lock state is an Apple choice and it is currently set at 10 minutes Therefore ScadaMobile just as any other application will be switched off or suspended after this time has ex pired Therefore end users need to be instructed to put ScadaMobile in the foreground as soon as they have completed other tasks and not to allow
112. ton style it defines the text for a but string ton write_access special Text in the form m n where m represents the minimum number of characters to be text displayed If the value to be displayed is shorter than this number the result is pad ded with blank spaces or zeroes if the number starts with zero The value is not truncated even if the result is larger n represents the number of digits to be displayed after the decimal point An optional format specifier character can be appended to n for further customization See Format Specifiers Example format 07 2 will display the REAL value 12 345 as 0012 34 Example format 8x will display the DINT value 1 as ffffffff prefix text Text to be prepended just before the variable value Example prefix pag 25 86 www sweetwilliamsl com sweetwilliam ScadaMobile TONI TEZZE Ul TYZyyv _ _ i TAG ATTRIBUTES KIND MEANING sutis tet Text to be appended to the variable value Example suffix value expression Specifies a value to write on the related tag based on the result of an expression see Expressions Note that the value attribute has a slightly different behavior for Internal tags than for regular PLC tags For PLC tags the result of the expression is first written to the PLC already con verted to the relevant type and appropriately limited and descaled according to the pounds and scale attributes On reading the tag value is scal
113. using as delimiter The relevant element from the split array is obtained with the fetch method We use 0 as the default value for fetching Note that we could have used simple array indexing such as _t split 3 to get each part of the original string but this would lead to potential out of bound errors if the original string had some missing part Particularly if the original string did only contain minutes and seconds such as 50 30 50 minutes 30 seconds the referred indexed expression would give an out of bounds error as it would attempt to access a non existing element the one before the first one Note also that in all cases we use negative indexing because we interpret that the last part is always meant to be the seconds the previous to the last one the minutes and so on The proposed expression can be optionally optimized by storing the split string in a temporary variable so that the splitting is only performed once If we apply this optimization the final solution would look as follows tspt STRING 3 INTERNAL value t split seconds DINT INTERNAL value 3600 tspt fetch 3 0 to_i 60 tspt fetch 2 0 to_i tspt fetch 1 0 to_i pag 54 86 www sweetwilliamsl com sweetwilliam ScadaMobile Creating a row that alternates between displaying the current time and an arbitrary value In this example we will create a row that shows a living digital clock showing the current time Every 5 seconds the time is alte
114. v windows Cyrillic Mac Identifies the Mac Cyrillic encoding Cyrillic Win Identifies the Windows Code page 1251 Slavic Cyrillic encoding Chinese Win Identifies the Windows Simplified Chinese encoding Chinese GB2312 Identifies the GB_2312 Chinese encoding Strings in source files containing UTF 16 characters will be converted automatically to UTF 8 regardless of the encoding specified on the source file The UTF 8 encoding is a multibyte character encoding derived from UTF 16 Like UTF 16 it can represent every character of all languages but unlike UTF 16 it is backward compatible with ASCII using only one byte for representing ASCII char acters pag 39 86 www sweetwilliamsl com sweetwilliam ScadaMobile 3 1 10 3 Use of International Characters in PLC Strings You can store international Strings in PLCs with ScadaMobile just as easily as you do with ASCII strings ScadaMobile will use the source file encoding identification to decode encode strings onto raw bytes in the PLC When storing international Strings into PLCs you must expect the number of bytes used and thus the PLC string length to be larger than the number of characters the string actually holds This is particularly notorious when storing Chinese or Japanese strings in PLCs The UTF 8 encoding for instance can use up to 6 bytes per character in a PLC However this does not affect how strings are allocated in ScadaMobile or the behavior of String methods an
115. w Hide Product 8 00000 BOOL pag 82 86 www sweetwilliamsl com sweetwilliam Aphorism ONE csv ScadaMobile Demonstrates de use of advanced Numeric String and Array expressions on attributes A feature is shown on each page ap proach The example is self contained and runs using only INTERNAL tags The following goals are demonstrated 1 Convert total seconds to a string in the form hh mm ss Alternate display Time Temperature Conversion between degrees Celsius and Fahrenheit Display Date Time string in several formats Default American Style German Style 2 3 4 Convert to and from Rectangular and Polar coordinates 5 Use of Binary Input and demonstration of Bitwise Operations 6 Access to the global Lookup Table and use in formatted expressions 7 Demonstration of the Bar Code Scanner tag style 8 Arbitrary custom Coloring and Blinking of values 9 Arbitrary custom Text on Boolean values 10 Conditional operations using either the Ternary operator or the If Clause null movistar gt 14 26 mal movistar gt Al Example 1 a Example 5 _ Input Values Total Seconds _Bitwise Operations Input Value A Scan Enter total seconds Enter binary data i 0 j Scanner Input Results n Value B o Formatted Value _ Total Time 01 01 01 Enter binary data s J Time string hh mm ss sai Bitwise Operations Result E OZ da AND 0000000000000000 ime string hh mm ss Total Seconds Calculated back from
116. words are sent The following global attributes help to deal with it Swapped words bytes options for modbus are global NIG D j1U gCRO ATTRIBUTES KIND byte_swap number boolean number boolean number boolean number boolean str_byte_swap The combined effect swap attributes is as follows MEANING ScadaMobile will use Modbus RTU over TCP instead of Modbus TCP This will allow for accessing serial modbus RTU devices behind an Ethernet to serial gate way not supporting MBAP Use the slave_id attibute on tags to route commands to the right modbus slave node Swaps words for 32 bit data such as DINT or REAL before sending to or upon re ceiving from a modbus device Non zero values are true Default value is false Swaps bytes for 16 or 32 bit data before sending or upon receiving from a modbus device Non zero values are true Default value is false Swaps bytes for string data before sending or upon receiving from a modbus device Non zero values are true Default value is false Assuming a default of ABCD for byte order where A is the Most Significative Byte MSB and D is the the Less Significa tive Byte LSB you can combine word_swap and byte_swap with the following results 1 word_swap false byte_swap false will give ABCD for 32 bit values and AB for 16 bit values 2 word_swap false byte_swap true will give BADC for 32 bit values and BA

Download Pdf Manuals

image

Related Search

Related Contents

Untitled  M0209 CONTROLADOR MASTER PRO V4  Juillet – Août – Septembre 2015 - La Cité des métiers du Val  STATION  

Copyright © All rights reserved.
Failed to retrieve file