Serial ModbusRTU without GUI

More
07 Mar 2011 10:15 #7614 by myed
Hi !

I'm trying to run classicladder without EMC.

If I run:
loadusr -w classicladder --modmaster mymill.clp

my ladder work OK!

If I run:
loadusr -w classicladder --nogui --modmaster mymill.clp

modbus not work!

Can anyone help?

Thanks,
Edward.

Please Log in or Create an account to join the conversation.

More
07 Mar 2011 19:26 #7619 by cmorley
You must have the gui running for modbus to work.
They are tied together and it looks like a lot of work to separate them.
Maybe I should add the ability to hide the GUI - that might be an easier hack.

Please Log in or Create an account to join the conversation.

More
08 Mar 2011 07:04 #7625 by myed
Thanks, Chris !

Not to worry. I am a novice user EMC and I assumed that Modbus can operate autonomously.
May be in main function classicladder.c add <<< if (modmaster) { PrepareModbusMaster( ); } >>>

if (nogui==TRUE)
{
rtapi_print("INFO CLASSICLADDER- No ladder GUI requested-Realtime runs till HAL closes.\n");
ClassicLadder_InitAllDatas( );
ProjectLoadedOk = LoadProjectFiles( InfosGene->CurrentProjectFileName );
if (pathswitch){ strcpy( InfosGene->CurrentProjectFileName, NewPath ); }


if (modmaster) { PrepareModbusMaster( ); } // here ???

InfosGene->LadderState = STATE_RUN;
ClassicLadder_FreeAll(TRUE);
hal_ready(compId);
hal_exit(compId);
return 0;
} else {

Thanks,
Edward.

Please Log in or Create an account to join the conversation.

More
08 Mar 2011 08:18 - 08 Mar 2011 08:19 #7627 by cmorley
Here's a patch to try.
It adds --hidegui to classicladder

You might have to add it by hand.

let me know if it works and i'll try to add it to the next major release.
Last edit: 08 Mar 2011 08:19 by cmorley.

Please Log in or Create an account to join the conversation.

More
08 Mar 2011 08:21 #7628 by cmorley
I had to rename it .txt as .patch is not allowed....

File Attachment:

File Name: hidegui.txt
File Size:3 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
08 Mar 2011 08:54 #7629 by myed
Thanks, Chris !

I 'll try and report the results.

Best regards,
Edward.

Please Log in or Create an account to join the conversation.

More
08 Mar 2011 19:20 #7654 by myed
Hi, Chris !

Your changes have helped.
EMC work with serial modbus classicladder and GUI don't show !
But now, when EMC closed, I get a message:




Best regards,
Edward.
Attachments:

Please Log in or Create an account to join the conversation.

More
09 Mar 2011 04:58 #7662 by cmorley
I think it is safe to ignore this error.
you can get the same warning if you load classicladder with a gui then 'unload classicladder' in the HAL environment.
It happens because when you unload a component it doesn't use the regular exit point of classicladder, it forces it to close.
This should probably be done better...

Chris M

Please Log in or Create an account to join the conversation.

More
09 Mar 2011 06:13 #7663 by myed
Hi, Chris !

I understood everything.
Thanks !

Best regards,
Edward.

Please Log in or Create an account to join the conversation.

Time to create page: 0.235 seconds
Powered by Kunena Forum