Detecting when a cicode function is running on a client

I want to detect when the cicode function is running on a client PC as opposed to a server (the server is running as a service).

I have a project recently upgraded from 7.2 to Citect 2018 and all the logging devices are set to be owned by processes (to allow historical logging to work correctly). I have created a new logging device for logging on a client PC (owned by the client instance) but want to have a single log function which can run on either a server or client and dynamically change which device it uses to update the my debug log.

I tried using ServerInfoEx but this throws an hardware error everytime it runs.

I'm probably doing something wrong as I am used to Citect 3.4-7.2

Parents
  • What about calling ProcessIsClient()? It will return TRUE if it is running in a client process. You could have a client process on a server computer, but I would think you would still want the client process to write to the client log. If you call the function from the report/alarm/trend/IO server process it will return FALSE. You can also use ProcessIsServer(servertype) to check for the specific server process.
Reply
  • What about calling ProcessIsClient()? It will return TRUE if it is running in a client process. You could have a client process on a server computer, but I would think you would still want the client process to write to the client log. If you call the function from the report/alarm/trend/IO server process it will return FALSE. You can also use ProcessIsServer(servertype) to check for the specific server process.
Children
No Data