C# Internal Error E1002, CILC0001
Any idea on what could be causing this error?
"Error","","E1002: [PlcSequenceEngine]Abl.PlcSequenceEngine.SeqParser.Parse(System.String) IL_006F : emitting of cil code failed"
"Error","CILC0001","Error during generating native code."
Here's the function in question:
public static Sequence Parse(string json) {
var jRoot = JSONParser.Parse(json);
var jSeqInfo = JSONParser.GetReqObj(jRoot, "Seq_Info");
var jCommands = JSONParser.GetReqArr(jRoot, "Commands");
return new Sequence(
name: JSONParser.GetReqStr(jSeqInfo, "Seq_Name"),
desc: JSONParser.GetReqStr(jSeqInfo, "Description"),
commands: Funcs.Map(jCommands, j => ParseCommand(j))
);
}
Comments
Hello Josh,
the eror message is: "emitting of cil code failed". I assume you would like to use a .Net standard library for Json parsing. Generally it is possible to add external libraries/opensourcesoftware in the C# environment (as source code or .dll lib), but you have to note that the .Net standard is not supported and .Net Core is not installed on plcnext target (it is possible that the used functions according to .Net standart will be not supported/executed on plc). The PLCnext (eCLR) C # only contains/supports what actually in the eCLR-Programming-Reference.chm is described (also linked in the project). The description is available here: http://plcnext-infocenter.s3-website.eu-central-1.amazonaws.com/PLCnext_Technology_InfoCenter/PLCnext_Technology_InfoCenter/Programming/Csharp/Csharp_Supported_functions.htm?d_f=falfal
As an alternative to PLCnext (eCLR) C #, the .NET Core Runtime can also be installed on the controller. Then you have the full C # functionality (according to the .NET Core version and the restrictions of a controller). But in this case you are completely in the non-realtime area and have to use e.g. OPC-UA as an interface, please see the overview graphic:https://www.plcnext.help/te/About/Home.htm
For fast solution, I would like to recommend you to use the JSON utility Library: https://www.plcnextstore.com/812/ .
Best Regards
Eduard