Home AMX User Forum AMX General Discussion

DEVICE_COMMUNICATING, DATA_INITIALIZED Confusion

Hi Guys,

I am a bit confused about these 2 channels - I am sure this has come up but typing these into the search brings up almost every post. If there is somewhere this is discussed somewhere - feel free to point me at it.

Standard SNAPI help in the Module Listener section

Channel 252 - DATA_INITIALIZED
Feedback Channel: Module data is synchronized with device while channel is on

Channel 251 - DEVICE_COMMUNICATING
Feedback Channel: Communication is established with device while channel is on

My interpretation of these 2 channels is:
Data_Initialized - After first connecting the module to device - info is pasted back/forward and when both are synced
then this channel is turned ON - turned OFF when one of the following happens: REINIT/reboot(or reload which reboots). This being clear by the 'ed' on the end - so it was initialized so now on.

Device_Communicating - When the device replies to a send string then this channel is set to ON. If no response after x time then turn OFF(simplistic description - I send the command 3 times then flag and try next command - if 3 commands fail then delay and REINIT). So if the device is talking back then this is communicating and when stops responding then set off.

Thought this was sorted until I come to RMS. I am using 3.3.33 - this may have been fixed in Enterprise but not sure.

RMSCommon.axi Line 175
// Duet Device Feedback Channel:
// Communication is established with device and device is initialized while channel is on
RMS_DUET_CH_DATA_INITIALIZED = 252 (* - added in v3.3 to support Duet VDV API *)

RMSModuleBase.ini Line 705
(*******************************************)
(* Channel: Duet virtual device *)
(* Duet Device Feedback Channel *)
(* Communication is established *)
(* with device and device is *)
(* initialized while channel is *)
(* on. (CH.252) *)
(* - added in v3.3 to support Duet VDV API *)
(*******************************************)
CHANNEL_EVENT[vdvDeviceModule,RMS_DUET_CH_DATA_INITIALIZED] // CH.252
{
ON:
{
// the Duet device is communicating
CANCEL_WAIT 'RMSCommTo'
RMSDeviceSetCommStatus(TRUE)
}
OFF:
{
// the Duet device is not communicating
// If not ignoring comms, set the communicating parameter to 'False'
IF (!bRMSIgnoreComms)
{
CANCEL_WAIT 'RMSCommTo'
RMSDeviceSetCommStatus(FALSE)
}
}
}


So Device online/offline in RMS 3.3 tracks Data_Initialized and not communicating. I had a device die and RMS tracked it as fine. This would imply that according RMS, I should be using Initialized to track if online/offline.

I can program to track if using RMS 3.3 and change this channel functions but thought I would ask first.
Any help in clarifying this for me?

Cheers Rob

Comments

  • DATA_INITIALIZED (252) should go off with DEVICE_COMMUNICATING (251) on the virtual device.
  • I've always understood DATA_INITIALIZED to be the "final step" in confirming that a device is working as expected. In my mind it goes:
    ONLINE ==> DEVICE_COMMUNICATING ==> DATA_INITIALIZED
    
    If any of the previous states are false, the following states are false as well.
  • I asked exactly the same question a little while ago which attracted a few comments, but I don't think a unanimous conclusion was reached. The thread is here.
  • NZRobNZRob Posts: 70
    Thanks guys, made somewhat clearer now
Sign In or Register to comment.