This document has information on the MQTTspB Simulator configuration and Runtime Behavior. Below you will find more information on the requirements and supported features.

Script Task

Each FactoryStudio Script Task is a thread running the typed content. It can be executed by Trigger (when a Tag value changed) or Period (configured time to run cyclically).

The whole management of execution must be done by FactoryStudio so it can do the correct management of used CPU to not allow excessive use of it, so you don't compromise other modules. Also, it will do the correct control of exceptions that may happen inside of the Script Task.



Diagnostic Information

Each execution of Script Task is monitor by FactoryStudio, then it is possible to know:

  • Last execution (datetime)
  • Last CPU time (duration to execute the Script Task)
  • Peak of Last CPU time
  • Execution count
  • State (Task running or idle)
  • Code exceptions



Data Synchronization

FactoryStudio is a distributed software, it means, there is a Server and the modules can run distributed in many computers.

So, there is a connection between the modules (Scripts, Datasets, Report, UI clients, etc) and there is data synchronization between the Server and those modules. There is an internal queue with the data to be synchronized. The tags can be in this queue only once.

If a module updates a tag value that is already in the queue only the value is updated, then this is a queue of last values of tags to be synchronized between Server and modules. When a tag changes values so fast many times it does not mean that all the values will be synchronized with the Server. For sure the last value will be. This way, we can guarantee that the queue does not blow out or there is not a memory leak, because the queue will have a maximum amount of tags in a project.

There are a few cases where the project must synchronize all the tag changes.

In this case the Tag property RaiseAllChanges must be enabled. However, you need to pay attention, if there are more value changes that the system can synchronize it will increase the queue of synchronization and may cause excessive use of used memory in the computer. If you create a Script Task or CodeBehind using a For / While and change the tag value inside of it and use the RaiseAllChanges property enabled it may have this behaviour.



Timeout

As explained before there is a connection between the Server and modules, then there is a timeout of 2min in this connection. In case there is a large object as a Datatable tag to be synchronized and it takes more than 2min to synchronize this timeout will be exceeded and will have an issue in the connection/synchronization of the modules.



Project Shutdown

When a project is shutdown, each module waits for all executions to be finished. Then there is a flush in the queue synchronization to make sure any tag value won't be lost. After finishing all the executions, the queue is empty and the module is closed, closing the connection with the Server. At the Server side, only after all modules are disconnected that it is shutdown.

  • No labels