-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not parse negated #2
Comments
but parse_ld_line works ok:
result all 1; |
Thank you for spotting this, I noticed this case is not covered in the
unit tests.
I will add it and come back to you.
ps. Isolating the vm is actually a very good idea, i was currently in
the works of a fork of the PLC library that is stand alone.
Best regards
Στις 2022-02-14 19:58, Hiperión έγραψε:
… but parse_ld_line works ok:
memset(&line, 0, sizeof(line));
line.buf = " ---!i0/5--(Q0/3 ";
result = parse_ld_line(&line);
printf("test: %d\n",result == PLC_OK);
printf("test: %d\n",line.cursor == strlen(line.buf) - 4);
printf("test: %d\n",line.status == STATUS_RESOLVED);
printf("test: %d\n",line.stmt->tag == TAG_ASSIGNMENT);
printf("test: %d\n",line.stmt->v.ass.type == LD_COIL);
printf("test: %d\n",line.stmt->v.ass.right->v.exp.op == IL_AND);
printf("test: %d\n",line.stmt->v.ass.right->v.exp.mod == IL_NEG);
printf("test: %d\n",line.stmt->v.ass.right->v.exp.a->tag ==
TAG_IDENTIFIER);
printf("test: %d\n",line.stmt->v.ass.right->v.exp.a->v.id.operand ==
OP_INPUT);
printf("test: %d\n",line.stmt->v.ass.right->v.exp.a->v.id.byte == 0);
printf("test: %d\n",line.stmt->v.ass.right->v.exp.a->v.id.bit == 5);
printf("test: %d\n",line.stmt->v.ass.right->v.exp.b == NULL);
result all 1;
--
Reply to this email directly, view it on GitHub [1], or unsubscribe
[2].
Triage notifications on the go with GitHub Mobile for iOS [3] or
Android [4].
You are receiving this because you are subscribed to this
thread.Message ID: ***@***.***>
Links:
------
[1] #2 (comment)
[2]
https://github.com/notifications/unsubscribe-auth/ADZCTAUE445XH2X42EGUYCLU3E7EXANCNFSM5OLVJSGA
[3]
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
[4]
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub
|
Thanks for the reply, |
Interesting, i think you will also need a hardware abstraction layer to
control the I/O on the ESP32, and possibly an OS abstraction layer, or
is your board running linux?
There are plans of implementing such abstraction layers in the
standalone PLC libary (but nothing concrete yet)
Στις 2022-02-15 15:26, Hiperión έγραψε:
… Thanks for the reply,
I work with ESP32 and my idea is to port the VM to this processor.
Apparently the negated state is "lost" when you compile the entire
program because when you compile just the line it does so correctly.
--
Reply to this email directly, view it on GitHub [1], or unsubscribe
[2].
Triage notifications on the go with GitHub Mobile for iOS [3] or
Android [4].
You are receiving this because you commented.Message ID:
***@***.***>
Links:
------
[1] #2 (comment)
[2]
https://github.com/notifications/unsubscribe-auth/ADZCTAQ7YK3NFDUBUBA2BXDU3JH7XANCNFSM5OLVJSGA
[3]
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
[4]
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub
|
Yes, is needed a HAL, but isn't a complex task. I use IDF, then freertos |
Have you seen the mentioned error? I really don't see where the denied status disappears ... very strange! |
I believe this is a printing issue rather than a parsing issue, from the look of it its probably a problem in dump_instruction(). |
Txs, |
I have send an email to you. |
Hello,
I have tried to compile the project on Fedora 35 without success.
I have isolated the VM and did a test of the LD parser. It works fine but it doesn't seem to recognize negated states.
Does it also happen in the original project?
The test is the following:
And the result:
this is the project:
https://github.com/hiperiondev/plc-ladder
The text was updated successfully, but these errors were encountered: