slink Client

Description

See slinkServer documentation for a general description of slink and a comparison with FABIAN and information on inter-working.

slinkClient connects to a slinkServer or FABIAN server to present remote BNCS devices to a local network.

It connects via TCP/IP with optional SSL encryption (when connecting to slinkServer only).

The slink system follows the same general principles as FABIAN control system link.

slink has slightly different philosophy to FABIAN in that there is one slinkClient for each remote site. This is easier to understand, allows easier maintenance.

The slink client/server provides extended BNCS addressing and large slot-size.

Dependencies

slinkClient requires CSI32 version 1.2.72 or later, or bncs_csi

slinkClient is Qt5 based application and requires the following DLLs in the path (these are all included in a default BNCS V4.x install):

  • Qt5Core.dll
  • Qt5Gui.dll
  • Qt5Network.dll
  • Qt5Widgets.dll

and this in the windows\lib\platforms directory (for V4.5), or in a platforms subfolder of the SystemPath specified for V3 in c:\bncs_config.ini:

  • qwindows.dll

If you are using SSL then the following additional DLLs are required (see note below about version-clash issues):

  • libeay32.dll
  • ssleay32.dll

Configuration

Command Line Overrides

/statusid=<device number>

Overrides the StatusInfodriver setting from the ini file so that you can have independent states shown for a main and reserve slinkClient instance

Otherwise, these are for not-recommended settings, but if you must:

/nocache

Disables the cacheing of data - means poll requests will always hit the link, data from the link will always hit the network whether or not it's changed

/nopollonconnect

Won't automatically poll on receiving device profile response from the server. Note: If you turn this off, also run /nocache too otherwise you end up with a cache of old data that is only refreshed on change of state.

Config file settings

Configuration may be set from the UI of the application and this writes the ini file. Setting from the UI has the advantage that changes are dynamic without having to restart the application. Don't forget to copy the resulting config back to your system file server!

There can be more than one slinkClient.exe application for any one system - so there must be more than one configuration file.

Configuration files are located in the "system config" location appropriate for your system. For V3 this is alongside BNCS database files, for V4-based systems it's %CC_ROOT%\%CC_SYSTEM%\config.

There is a default file:

slinkClient_default.ini

but you can supply a command line parameter which is a profile name. So a command line of:

slinkClient myRemoteSystem

results in config being taken from:

slinkClient_myRemoteSystem.ini

This is a sample ini file, but all these values should be edited from within slinkClient itself, and you have to edit the ControlPass using the editor.

[slink]
;This can be a dotted network address but for SSL to work should be the DNS name of the server which must match the SSL certificate
;Default port is 46277
Address=team.bncs.tv
Port=46277
AltAddress=team2.bncs.tv
AltPort=46277

;status infodriver can show connection status
StatusInfodriver=2
;alternatively use NS message - you can always query these, but they are only generated spontaneously if enabled (non-zero) here
SendSpontaneousNS=1

;Login credentials for the remote slinkServer
;ControlPass is encrypted and cannot be copied between client/server
UserName=A
UserPass=B
ControlPass=Hcoe8JcnG//ySgsZzatG59041GNm6uYN7b334zakxJs+j9vbjMXKEDTdR7nbb6TrqjDRngf4RdOxm7ItzEplTGRaLSiIuQ/imyyMQeUpbsiieXD01riKrR/WrY1qqodo

;non-zero indicates the connection should be SSL
SSL=1

;This application may optionally use a SOCKS proxy so the connection may tunnel out. Set address and port and optional user credentials here
SocksAddress=
SocksPort=0
SocksUser=
SocksPassword=

;BNCS device list. These are the BNCS devices that this link will create on the local network and will pass messages to/from the remote network
;entries are of format <local>,<remote>,<type I|R|G>
;remote is optional and can be used to map the device number
;type is optional and sets either Infodriver, Router or GPI. This defaults to I
device_1=123
device_2=124,1
device_3=125,125,R

Security

This application will use SSL if configured. This only works if the "Address" of the server matches the SSL certificate that the server presents.

Refer to the slinkServer documentation with regards to notes on setting up SSL as there are changes for the client AND server config needed to make this work.

Client authentication could be made to work but is not currently configured.

Redundancy

You can run slinkClient in pairs to provide redundancy.

CSI32 introduced redundancy mastering (in CSI32 version 1.2.59) to allow for a single device to control the TxRx state of all it's siblings. slink relies on this to maintain consistency of all its drivers and to provide the redundancy mechanism for the link itself. Unlike FABIAN slink does not use, or require 'F' messages.

You cannot run slinkClient and FABIANLink32 presenting the same devices to the one system, but you can use slinkClient and FabianLink32 for different devices.

You can set slinkClient to connect to two different servers - providing a "main" and "alternate" address. If a connection cannot be made on one, then the other is tried (providing it's a valid address).

Closedown

To closedown with CSI slinkClient requires a client connection to CSI. Client connection is not compulsory.

Connection status

If a device number is supplied in the config file or via command-line override.

Slot layout

Slot | Notes
1 | "1" if connection is made, and "0" if there is no connection. This mimics exactly the green/red, ok/failed indication on the UI
2 | Current connection information - this reflects the connection information shown on the UI e.g. "127.0.0.1:23 MAIN". This value is null if there is no connection

Network Status Messages

These are a historic messaging mechanism for BNCS revitalised for slink to show connection information regardless of redundancy state

The following messages are supported:

Key | Spontaneous | Notes
txrx | No | tx, rx or unknown
peer | Yes | address/name of server
address | Yes | ip address of server
port | Yes | port of server
alt | Yes | 0 if on "main" address, 1 if on alternate
fabian | Yes | 0 on no connection, 3 on connected/rxonly, 4 on connected/txrx
_module | No | module filename including path
_version | No | module version

peer, address and port always change together, and if any-one of them is "set" (not blank, not zero) a connection is made.

"Spontaneous" indicates if this message is sent when the value changes. Dest workstation is set to 0 so that any workstation with a normal "revertive" registration can receive it.

Directed messages (queries to a specific workstation) will work with any CSI32 version, but the spontaneous events will only be delivered to CSI32 version 1.2.83 or later.

Repoll on connection

slinkClient represents the state of BNCS devices on a remote network, so on start-up it has to get the state of those devices.

On connection made it polls all the devices for which it's configured taking the range from the "DatabaseSize_1" configuration in the database file for that device.

To prevent a massive dump of information to the slinkClient network, it maintains a cache of the data for all the devices configured. On connection lost/restored or application restart the amount of traffic on the slinkClient network should be minimal as it sends only changes since last connection. This also has the effect that it will not send values to the network if they are unchanged. This might affect the dynamics you expect when you send an InfoWrite, expect a revertive but never get one because you are reasserting an existing value.

Debug/Diagnostics

It is a design decision that the application debugging is events only. If you want traffic level debugging then all of this is available using an external debugger.

The reasons for this are:

you actively have to run an external debugger if you want that level of detail (you can't just leave it enabled so ruining the performance of this application)
external debugger may have far better filtering/highlighting than is usually available on applications such as these

Version History

Version | Date | Notes
1.0.0.1 | 01/02/2016 | development version
1.0.0.2 | 16/02/2016 | development version
1.0.0.3 | 11/03/2016 | adds log-to-disk, fixes closedown crash
1.0.0.4 | 17/03/2016 | tidies up registration of drivers so that it behaves on duplicate local registration
1.0.0.5 | 17/03/2016 | flushes cache when removing driver (just saves a bit of memory, and removing reinstating a driver doesn't pull up a load of out-of-date guff). Logging a bit better behaved
1.0.0.6 | 17/10/2017 | Registers the entire range as defined by BNCS_V6
1.0.0.7 | 24/10/2017 | Router modify handling (kinda)
1.0.0.8 | 26/10/2017 | Router modify handling (anti-howlround)
1.0.0.9 | 30/10/2017 | Doesn't now propogate database changes when not in TXRX
1.0.0.10 | 06/12/2017 | Closes with CSI
1.0.0.11 | 08/12/2017 | More considered implementation of 1.0.0.10 (close with CSI)
1.0.0.12 | 21/12/2017 | Conversion of docs to markdown
1.0.13.0 | 30/01/2018 | Adds rudimentary infodriver status slot
1.0.14.0 | 24/04/2018 | Removes extended range support
1.0.15.0 | 15/05/2018 | RD support (to match FABIAN for anti-howlround)
1.0.16.0 | 16/05/2018 | Now only sends revertives on change of state. Allows for wholesale polling of the server without bothering the local network with information that hasn't changed
1.0.17.0 | 18/05/2018 | Persists state (as say an infodriver would) on closedown. Also implements ADP command which it uses for startup poll. NOTE change of ini file settings to include the device type
1.0.18.0 | 21/05/2018 | Now doesn't barge the existing TxRx driver out of the way on startup. Another couple of messages logged to debug. Better behaved creating device connections from the UI.
1.0.19.0 | 21/05/2018 | UI button relabelled "Force tx"
1.0.20.0 | 22/05/2018 | Minor wrinkle ironed out when doing quick-add of driver. Not entering a valid local device would tell you it hasn't got a db1 size. NSS.
1.0.21.0 | 23/05/2018 | Cross checks the value from the ADP response against the local DB1 size, and flags in the debug if there's an anomaly
1.0.22.0 | 29/05/2018 | Adds traffic counters to BNCS and session. Adds missing editor for user credentials and status infodriver
1.0.23.0 | 29/05/2018 | Minor tarting following code review
1.0.24.0 | 30/05/2018 | Updated documentation to include device type setting and to clarify ini file location and SSL settings
1.0.25.0 | 31/05/2018 | Expands socket error message (as per slinkServer)
1.0.26.0 | 15/06/2018 | Makes cache a command line option
1.0.27.0 | 18/06/2018 | Makes poll on connect (or at least no poll on connect) a command line options
1.0.28.0 | 12/07/2018 | Adds "V3" search path for finding Qt plugins to path defined in c:\bncs_config.ini (or V2 default of Windows)
1.0.29.0 | 19/07/2018 | Sets path to log after getting the profile name (otherwise path can't contain that profile name)
1.0.30.0 | 02/08/2018 | Adds more explicit debug message about the need for databasesize_1 server-side
1.0.31.0 | 28/08/2018 | Reoccurrence of an old favourite - where % appears in the data and is misinterpreted as placeholder in debug messages
1.0.32.0 | 28/08/2018 | RUR to RUT command (sends reply to "are you there?"). Rewrites incoming stream splitter to allow for random null bytes that early versions of FabianServer stuff in. This also makes the parser more efficient (reads blocks, not individual characters)
1.0.33.0 | 21/09/2018 | More discerning about what to register for. I reailsed that if you're talking to a remote DDS CSI with 65k slots but you only support 4096 that ain't gonna work, but also if you're a DDS CSI client trying to ask for 65k slots off FABIAN isn't going to work either. Pratically this just means use the return value from the ADP
1.0.34.0 | 09/11/2018 | IP address/port validity checking before trying to use them. Also corrects long-standing hole using main port number instead of alt port number in the editor. Adds statusid command line param to override the config file. Adds connection string to the status infodriver. Attempts to put status infodriver Txrx on connection.
1.0.35.0 | 13/11/2018 | Removes case sensitivity of config key values, sets default entries for UserName, Password, ControlPassword to be consistent with slinkServer
1.0.36.0 | 23/11/2018 | Will use NS message (using the ID of the first BNCS device) to update the connection status to the network without the need for an independent status infodriver. Also makes status infodriver send slots on change only.
1.0.37.0 | 28/11/2018 | Further massaging of NS messages (not done yet)
1.0.38.0 | 29/11/2018 | NS messages now consistent format, sent appropriately and may be queried
1.0.39.0 | 29/11/2018 | disconnects on login failure (BST-362). Minor updating of NS messages
1.0.40.0 | 03/12/2018 | Adds option to disable spontaneous sending of NS values for connection state
1.0.41.0 | 06/12/2018 | Adds editor for feature in 1.0.40
1.0.42.0 | 11/12/2018 | Gives in and adds basic FABIAN-style status via NS message so that it can be casually turned around in an aggregating device
1.0.43.0 | 30/08/2019 | Sets connection status (for return with NS command) so that it's in default (disconnected) on startup
1.0.44.0 | 18/09/2019 | BST-625 flip on remote closing connection (for fast-changeover)
1.0.45.0 | 24/02/2020 | BST-735 makes device config reading multi-standard. Will accept 1,1,R or 1,R, or (with default of infodriver) 1, or 1,1
1.1.0.0 | 26/03/2020 | COMPATIBILITY WARNING BST-496 Now encrypts control password value - old password values will not work and will be actively rejected. BST-423 makes config keys consistent with slinkServer BUT you can't copy/paste encrypted keys between server and client because the encryption is different. CORE-50 removes blank but rippable toolbar item
1.1.1.0 | 22/03/2020 | Doesn't spit outgoing password value to the debug
1.1.2.0 | 10/06/2020 | BST-826 Adds secondary (GRD) source for device name according to long-standing convention if the first attempt to get the name retrieves null-string
1.1.3.0 | 09/10/2020 | BST-895 Password encryption functions badly behaved (unrelated behaviour) - corrected
Build: bncs_4.7.5 5800 a1b48197a Atos|Syntel © 2021