Welcome Guest ( Login | Register )



All times are UTC - 7 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Using 2 CAN channels tags to drive the same Gauge
PostPosted: Wed Aug 23, 2017 5:05 pm 

Joined: Tue Aug 15, 2017 11:08 pm
Posts: 1

Offline
Hi,

I'm trying to create a script so that I can have redundancy if one CAN link fails for whatever reason. The gauges and all other sending and receiving should use CAN 1 but change to CAN 2 if CAN 1 fails.

I've been pulling my hair out all week and can't work out how to do it. This is my latest attempt using heartbeat messages to force updates but it still won't work. I've set a test gauge to the vStbdStrIndication tag and I am trying to update that value from either CAN tag. Is this the correct way to do this?

I've proven that I can get communication on both CAN 1 and CAN 2 but can't get the screen to swap between them. I've also set up on screen pictures which show that the Valid (timeout) tags are updating correctly so I'm pretty sure I'm missing something with the scripting.

Any help would be greatly appreciated. Thanks, Mitch

Code:
    public partial class Tags
    {         
      void iStnHB_ValueChange(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
      {
         if (Globals.Tags.iError_No_Valid.Value == 1)
            Globals.Tags.vStbdStrIndication.Value = Globals.Tags.iStbdStrIndication.Value;
         else
            Globals.Tags.vStbdStrIndication.Value = Globals.Tags._2iStbdStrIndication.Value;
      }
         
      void _2iStnHB_ValueChange(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
      {
         if (Globals.Tags.iError_No_Valid.Value == 0)
         {
            if (Globals.Tags._2iError_No_Valid.Value == 1)
               Globals.Tags.vStbdStrIndication.Value = Globals.Tags._2iStbdStrIndication.Value;
            else
               Globals.Tags.vStbdStrIndication.Value = 1000;
         }
      }         
    }


 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 7 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: