PMC_RDPMCRNG from within the Focas library | I want to pull this function using the ready-made function below, but I am getting an error in the byte part, can you help?
public short sample(ushort start=3, ushort end=4)
{
short ret, idx;
short adr_type, data_type;
ushort length;
adr_type = 2; // In case that kind of PMC address is G
data_type = 0; // In case that type of PMC data is Byte
length = (ushort)(8 + (end - start + 1));
byte[] bytes = new byte[length];
ret = Focas1.pmc_rdpmcrng(_handle, adr_type, data_type, start, end, length, bytes[1]);
if (ret == Focas1.EW_OK)
{
for (idx = 0; idx <= end - start; idx++)
{
Console.WriteLine("#{0:d4} 0x{1:X2}", idx, bytes[8 + idx]);
}
}
else
{
Console.WriteLine("ERROR!({0})", ret);
}
return (ret);
}