Hi all,
I am trying to access and manipulate FANUC V9.30P/08 controller's registers using PCDK (version V9.30(Rev.B)) in C#. Please help me understanding why the following code does not work:
C#
using System;
using FRRobot;
namespace PCDK_Project_1
{
class Program
{
static void Main(string[] args)
{
FRCRobot myrobot = new FRCRobot();
string ip_str = "127.0.0.1:3002";
myrobot.Connect(ip_str);
bool is_connected = myrobot.IsConnected;
FRCVars robot_registers = myrobot.RegNumerics;
FRCVar layer = robot_registers[6];
Console.WriteLine("Access Code: " + layer.AccessCode);
Console.WriteLine("Id: " + layer.FieldName);
Console.WriteLine("Name_Id: " + layer.VarName);
Console.WriteLine("Value: " + layer.Value);
Console.WriteLine("Value: " + layer.Value.RegLong);
//Console.WriteLine("Value: " + layer.Value.Long); // This one does not work either :(
}
}
}
Display More
The outputs (belows) indicates that "RegLong" does not exist in "FRCVar" object.
Code
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
HResult=0x80131500
Message='System.__ComObject' does not contain a definition for 'RegLong'
Source=<Cannot evaluate the exception source>
StackTrace:
<Cannot evaluate the exception stack trace>
However, I have followed these threads and this seeing that the similar syntax work. Can anyone please help?