Ejemplo n.º 1
0
 public static void UpdateProductInLoadingStatus(PlcMaster master, ProductStatus productStatus)
 {
     byte[] dummy = { };
     if (master == null)
     {
         return;
     }
     if (master.connected)
     {
         master.WriteSingleRegister(1, 1, master.LoadingStateStartAddress, ModbusTcpHelper.WordArrayToByteArray(new[] { Convert.ToInt32(productStatus) }, 1), ref dummy);
     }
 }
Ejemplo n.º 2
0
 public static void WriteActiveReference(PlcMaster master, string reference)
 {
     if (master == null)
     {
         return;
     }
     if (master.connected)
     {
         var data = ModbusTcpHelper.AsciiStringToByteArray(reference);
         master.WriteMultipleRegister(106, 1, master.ActiveReferenceStartAddress, data, ref data);
     }
 }
Ejemplo n.º 3
0
 public static void WriteProductInUnloading(PlcMaster master, string dataMatrix)
 {
     if (master == null)
     {
         return;
     }
     if (master.connected)
     {
         var data = ModbusTcpHelper.AsciiStringToByteArray(dataMatrix);
         master.WriteMultipleRegister(105, 1, master.UnloadingDataMatrixStartAddress, data, ref data);
     }
 }
Ejemplo n.º 4
0
 public static void SetUniqueIdentityLength(PlcMaster master, int length)
 {
     byte[] dummy = { };
     if (master == null)
     {
         return;
     }
     if (master.connected)
     {
         master.WriteSingleRegister(5, 1, master.UniqueIdentityLengthAddress, ModbusTcpHelper.WordArrayToByteArray(new[] { length }, 1), ref dummy);
     }
 }
Ejemplo n.º 5
0
 public static void SetVirtualIndexer(PlcMaster master, VirtualIndexerStates virtualIndexer)
 {
     byte[] dummy = { };
     if (master == null)
     {
         return;
     }
     if (master.connected)
     {
         master.WriteSingleRegister(4, 1, master.VirtualIndexerStartAddress, ModbusTcpHelper.WordArrayToByteArray(new[] { Convert.ToInt32(virtualIndexer) }, 1), ref dummy);
     }
 }
Ejemplo n.º 6
0
 public static void SetTraceabilityStates(PlcMaster master, TraceabilityStates traceability)
 {
     byte[] dummy = { };
     if (master == null)
     {
         return;
     }
     if (master.connected)
     {
         master.WriteSingleRegister(3, 1, master.TraceabilityStateStartAddress, ModbusTcpHelper.WordArrayToByteArray(new[] { Convert.ToInt32(traceability) }, 1), ref dummy);
     }
 }