Skip to main content
Version: 8.3

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​

TypeParameterDescription
StringppidThe 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​

Vision Client

Code Examples​

Code Snippet
# Retrieve information on all programs. 
results = system.secsgem.getToolProgramDataset()

for program in results:
# 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)

# Print the program. Writing to a file would most
# likely be a better practice here.
print "Program %s: %s" % (ppid, programData[1])