Hi,
I have to call c# code compiled (dll) to communicate with scale. Can you please see code and help me to call this class from clarion ?
Can this code be call with interop ?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace GrifmannRongtaWeightDriver
{
public class pcbox
{
///
[DllImport(“pcboxdllv1.dll”)]
// comn=1 -> is COM1
// comn=2 -> is COM2
public static extern int pcbox_InitAndOpenComm(int comn);
[DllImport("pcboxdllv1.dll")]
//close commx
public static extern int pcbox_CloseComm();
[DllImport("pcboxdllv1.dll")]
// SEND TARE COMMAND
public static extern void pcbox_tare();
[DllImport("pcboxdllv1.dll")]
// SEND ZERO COMMAND
public static extern void pcbox_zero();
[DllImport("pcboxdllv1.dll")]
// SEND ZERO COMMAND
public static extern void pcbox_reset();
[DllImport("pcboxdllv1.dll")]
// GET INFORMATE OF SCALE
// NetWeight =12345 --> weidht is 12.345kg
// TareWeight =12345 --> tare weidht is 12.345kg
// IsStable =1 --> weidht is stabled; IsStable =0 --> weidht is unstabled;
// Atzero =1 --> weidht is 0; AtZero =0 --> weidht not at 0;
// AtTare =1 --> have tare weight; AtTare =0 --> no tare weight;
public static extern int pcbox_GetWeight(ref int NetWeight, ref int TareWeight, ref int IsStable, ref int AtZero, ref int AtTare);
}
}