system.secsgem.getToolProgram
This function is used in Python Scripting.
Description
Returns a process program from the Gateway that was previously sent by a a tool in an S7F3 message.
Client Permission Restrictions
This scripting function has no Client Permission restrictions.
Syntax
system.secsgem.getToolProgram(ppid)
Parameters
Type | Parameter | Description |
---|---|---|
String | ppid | The PPID that was sent from the tool when the S7F3 message was saved. |
Returns
Dictionary - A Python Dictionary containing the following keys: [editDate, ppbody, bodyFormat].
editDate
- holds the last date the program was saved.ppbody
- holds the actual program.bodyFormat
- holds the format ('A', 'B', 'I', etc) of the original message PPBODY.
Scope
Gateway, Designer, Client
Code Examples
Code Snippet
# Retrieve information on all programs, and convert them to a PyDataset.
# PyDatasets are easier to iterate over.
results = system.secsgem.getToolProgramDataset()
pyResults = system.dataset.toPyDataSet(results)
for program in pyResults:
# If the format of the program is ASCII...
if program[2] == "A":
ppid = program[0]
# ...retrieve more information on the program...
programData = system.secsgem.getToolProgram(ppid)
# ...and print the program. Writing to a file would most
# likely be a better practice here.
print "Program %s: %s" % (ppid,programData[1])