Difference between revisions of "Programming"

From HSYCO
Jump to navigation Jump to search
 
(9 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
HSYCO offers an extremely powerful programming framework, allowing you to easily create complex programming logic that can be quickly integrated with the user interface functions, the field systems and HSYCO’s native features.
 
HSYCO offers an extremely powerful programming framework, allowing you to easily create complex programming logic that can be quickly integrated with the user interface functions, the field systems and HSYCO’s native features.
  
[[File:programming_architecture_model.png|border|800px|center]]
+
[[File:system_architecture_model.png|border|800px|center]]
  
 
At its core, HSYCO is an events based architecture, optimized to quickly process any status change from the low-level drivers or its internal services, and allows you to write custom code that is triggered by these events.
 
At its core, HSYCO is an events based architecture, optimized to quickly process any status change from the low-level drivers or its internal services, and allows you to write custom code that is triggered by these events.
Line 24: Line 24:
 
Anyways, EVENTS, JavaScript and Java are fully interoperable and integrated, with specific solutions to let you merge code components of the different languages into a seamless application.
 
Anyways, EVENTS, JavaScript and Java are fully interoperable and integrated, with specific solutions to let you merge code components of the different languages into a seamless application.
  
== Status Browser ==
+
== Using the Status Browser ==
  
An HSYCO application, no matter whether it is written in EVENTS, JavaScript or Java, inteacts with external systems through I/O data points, and with the user by dynamically setting user interface attributes.
+
An HSYCO application, no matter whether it is written in EVENTS, JavaScript or Java, interacts with external systems through I/O data points, and with the user by dynamically setting user interface attributes.
  
 
It also uses variables to save and retrieve internal state information.
 
It also uses variables to save and retrieve internal state information.
Line 32: Line 32:
 
When testing an application it is extremely useful for the developer to be able to access this information.
 
When testing an application it is extremely useful for the developer to be able to access this information.
  
The Status Browser, in the Manager toolkit, allows you to show the real time status of data points, user interface attributes and variables.
+
The '''[[Status Browser]]''', in the '''[[Manager]]''' toolkit, allows you to show the real time status of data points, user interface attributes and variables.
 
 
Open the Manager at '''<nowiki>https://192.168.0.50/hsycoserver/manager</nowiki>''' and press the Status Browser icon.
 
 
 
 
 
[[File:Manager_status_browser_data_points.png|border|center]]
 
 
 
 
 
The data point tab shows the real time values of all I/O data points, and the time stamp of each data point last change.
 
 
 
You can pause the real time update, and filter the list by data point name.
 
 
 
 
 
[[File:Manager_status_browser_ui_attributes.png|border|center]]
 
 
 
 
 
The UI attributes tab shows all user interface ids and attributes with values that have been set with the UISET or uiSet() methods.
 
 
 
In order to view session specific attributes, you should open a tab or window on the same browser where you are using the Manager, and then select the show session data checkbox in the Status Browser. This will show both global and session data for that tab.
 
 
 
 
 
[[File:Manager_status_browser_variables.png|border|center]]
 
 
 
 
 
The variables tab shows the values of all volatile and persistent variables.
 
  
 
== Events ==
 
== Events ==
Line 67: Line 43:
  
 
== JavaScript ==
 
== JavaScript ==
[[javascript programming| JavaScript]]
+
[[JavaScript Programming|JavaScript]]
  
 
[[JavaScript Callback Functions API]]
 
[[JavaScript Callback Functions API]]
Line 79: Line 55:
  
 
[[Java Command and Utility Methods API]]
 
[[Java Command and Utility Methods API]]
 +
 +
== Creating User Interfaces ==
 +
[[Working with User Objects]]
 +
 +
[[Working with Forms]]
 +
 +
[[Draw API]]

Latest revision as of 18:11, 12 March 2014

HSYCO offers an extremely powerful programming framework, allowing you to easily create complex programming logic that can be quickly integrated with the user interface functions, the field systems and HSYCO’s native features.

System architecture model.png

At its core, HSYCO is an events based architecture, optimized to quickly process any status change from the low-level drivers or its internal services, and allows you to write custom code that is triggered by these events.

You can write code in Java, JavaScript and a simple, proprietary language called EVENTS.

Java is precompiled, offers the best performance and powerful programming features of a fully standard Java language, but requires restarting HSYCO every time you make changes to the code.

On the other hand, EVENTS is a very simple declarative language, that associates one or more actions to a field event or combination of conditions.

Programming EVENTS is as simple as editing a text file, and all changes are immediately effective the moment you save the file. It is also a very effective way to quickly associate actions to events, faster than Java in many simple cases, and easier to read.

Finally, JavaScript is the middle ground, combining some of the best features of a powerful, standard programming language like Java, and the simplicity and efficiency of EVENTS. In fact you can write JavaScript code seamlessly mixed with EVENTS.

These diversified programming tools should not be considered to be confusing, but a flexible approach to address different problems with different solutions.

An experienced Java developer may decide to code all its custom logic in Java, because everything that can be done in JavaScript or EVENTS can also be implemented in Java, but will most likely appreciate the convenience of both EVENTS and JavaScript for some tasks.

But, if software development is not your business, you will definitely stay with EVENTS and possibly some JavaScript, and quite likely never need to use Java.

Anyways, EVENTS, JavaScript and Java are fully interoperable and integrated, with specific solutions to let you merge code components of the different languages into a seamless application.

Using the Status Browser

An HSYCO application, no matter whether it is written in EVENTS, JavaScript or Java, interacts with external systems through I/O data points, and with the user by dynamically setting user interface attributes.

It also uses variables to save and retrieve internal state information.

When testing an application it is extremely useful for the developer to be able to access this information.

The Status Browser, in the Manager toolkit, allows you to show the real time status of data points, user interface attributes and variables.

Events

Events

Event Keywords

Action Keywords

JavaScript

JavaScript

JavaScript Callback Functions API

JavaScript Command and Utility Functions API

Java

Java

Java Callback Methods API

Java Command and Utility Methods API

Creating User Interfaces

Working with User Objects

Working with Forms

Draw API