VB Script / VBA Methods
Let's start:
- download the helper.
- unzip it.
- Open a command line and go to C:\Windows\Microsoft.NET\Framework\[your-net-version].
- Execute RegAsm.exe [path-to-ZeusAPI.dll] /codebase.
- Once created your script, you can launch it with C:\Windows\SysWOW64\cscript [path-to-your-script].
Create
Create a new instance of the Client class and establishes the connection to the Zeus Server.
You can obtain your authaccount and authpass once logged on ZeusWeb, going to URL: api_credentials.html.
Parameters:
- ip. String. IP of the Server.
- port. UInteger. Port of the server. For example: 4040.
- SSL. Boolean. Use SSL. For example: true.
- authaccount. String. The authaccount you can get on Zeus Web URL: api_credentials.html. Please check that user has the property "API enabled" in the Server.
- password. String. Zeus Web account password.
- authpass. String. The authpass you can get on Zeus Web URL: api_credentials.html
Exceptions:
- Parameters: The input parameters are incorrect.
- Conection: Unable to connect to Server.
- Authentication: Request Authentication incorrect.
IsCreated
Returns a Boolean indicating if the client is created.
GetZeusApiLastError
Returns a String indicating the last error in ZeusApi.
GetLastKnownValues
Gets the last known values of a station.
Parameters:
- stationID. String. ID (ZeusID) of the station.
Returns a LastKnownValuesAPI object (details) or Nothing if an error occurred:
SetLastKnownValues
Sets the last known values of a station.
Parameters:
- stationID. String. ID (ZeusID) of the station.
- values. LastKnownValuesAPI. Values of the station to upload (details).
Returns True if everything went OK, or False if there was some problem. You can look in the GetZeusApiLastError variable to get more details in case of error.
GetStationProperties
Gets the station properties like model, serial, group, latitude, longitude, name and unit of every channel and channel views.
Parameters:
- stationID. String. ID (ZeusID) of the station.
Returns a StationPropertiesAPI object (details) or Nothing if an error occurred:
GetStationExtendedProperties
Gets the station extended properties like name, ZeusID, model, serial, group, latitude, longitude, name and unit of every channel and channel views... Contain all members returned by the GetStationProperties function plus new fields (the number of fields returned may vary with future versions).
Parameters:
- stationID. String. ID (ZeusID) of the station.
Returns a DictionaryStringObject, containing the variables and the value of the properties of station (details) or Nothing if an error occurred:
- ["Model"] = String with the model of the device for example "NEMOS_N200", "HERMES_M100", etc.
Stations
Gets the list of stations of this user.
Returns a ListString, containing the list of stations this user can access (details) or Nothing if an error occurred:
OnlineStations
Gets the list of stations currently online (connected to server) of this user.
Returns a ListString, containing the list of stations currently online (connected to server) from the list of stations this user can access (details) or Nothing if an error occurred:
SendMessage
Sends a message to the specified station or phone number.
Parameters:
- destination. String. ID (ZeusID) of the station ,(or the phone number, only if sendBySMS parameter is True)
- messageText. String. The text of the message to be sent.
- sendBySMS (OPTIONAL). Boolean. Indicates if the message should be sent by SMS or enqueued to the Server for the next time the station connects to the server.
Returns True if message was sent or enqueued succesfully, or False if there was some problem. You can look in the GetZeusApiLastError variable to get more details in case of error.
PendingMessages
Gets the list of pending messages enqueued for stations of this user.
Returns a ListKeyValue, where keys are Stations IDs and Values are message texts (details) or Nothing if an error occurred:
GetHistorical
Gets historical values of the specified station, date interval, and list of channels.
Parameters:
- stationID. String. ID (ZeusID) of the station.
- startDate. Date. The begin date of the interval of historical you are asking for.
- endDate. Date. The end date of the interval of historical you are asking for.
- channels. ListInteger (details). List of channels IDs . See Channels Enumeration.
Returns a ListHistorical object (details) or Nothing if an error occurred:
SetHistorical
Uploads a list of historical values of the specified station.
Parameters:
- stationID. String. ID (ZeusID) of the station.
- historicalValues. ListHistorical object (details)
Returns True if historical was sent succesfully, or False if there was some problem. You can look in the GetZeusApiLastError variable to get more details in case of error.
GetAlarm
Gets alarms values of the specified date interval.
Parameters:
- startDate. Date. The begin date of the interval of historical you are asking for.
- endDate. Date. The end date of the interval of historical you are asking for.
- sinceThisRawValue (OPTIONAL). String. If you prefer, instead of using startDate and endDate, you can specify the raw value of an alarm record, so you will get records after that alarm. When using this, startDate and endDate values will be omitted.
Returns a ListAlarms object (details).
SetAlarms
Uploads a list of alarms values of the specified station.
Parameters:
- alarmValues. ListAlarms object (details).
Returns True if alarms was sent succesfully, or False if there was some problem. You can look in the GetZeusApiLastError variable to get more details in case of error.
GetConfigurationRelay
Gets the programmable relay period of a station.
Parameters:
- stationID. String. ID (ZeusID) of the station.
- output. UInteger. output of the station.
Returns a ListProgrammableRelayPeriodAPI object (details) or Nothing if an error occurred:
SetConfigurationRelay
Set a ProgrammableRelayPeriod to the specified station.
Parameters:
- destination. String. ID (ZeusID) of the station.
- output. String. The output to configure.
- myFrameTime. ListProgrammableRelayPeriodAPI (details). List that contains a maximum of 4 elements with the configuration..
Returns True if configuration was sent, or False if there was some problem. You can look in the GetZeusApiLastError variable to get more details in case of error.