Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: MarkTTU on February 01, 2024, 11:44:38 AM

Title: Setting IP using SETUPIP on BX-P-ECOMEX
Post by: MarkTTU on February 01, 2024, 11:44:38 AM
I'm trying to set the IP of a BX-P-ECOMEX POM using the SETUPIP instruction, but every time that instruction runs my PLC reboots. I briefly get an error that says

"An operation was attempted that is illegal in current mode or configuration...in SETUPIP at Set POM IP@2."

And the specific ERR shows as

"ERR: panic @008ED8E4: exit_hook|"

Any thoughts on what I'm doing wrong here? I can successfully set the IP of a BX-P-ECOMLT just fine.
Title: Re: Setting IP using SETUPIP on BX-P-ECOMEX
Post by: MarkTTU on February 01, 2024, 11:45:48 AM
I should add that the IP of the built-in ethernet port is 172.20.99.42 with a 255.255.254.0 subnet.
Title: Re: Setting IP using SETUPIP on BX-P-ECOMEX
Post by: BobO on February 01, 2024, 11:47:29 AM
Well that ain't good.
Title: Re: Setting IP using SETUPIP on BX-P-ECOMEX
Post by: MarkTTU on February 01, 2024, 11:50:56 AM
And I just figured it out... turns out I'm an idiot  ::)

I had copied this instruction from a different program (just being lazy) and then neglected to update or even notice that upon both error or success the instruction jumped back to the same stage that holds the instruction. Now that I don't have it trying to perform an infinite loop all is well.
Title: Re: Setting IP using SETUPIP on BX-P-ECOMEX
Post by: MarkTTU on February 01, 2024, 11:52:29 AM
Well that ain't good.
Not ideal anyway ;)

I was really thrown by the "panic" error, but now that I realize what I did that error from the CPU makes perfect sense.
Title: Re: Setting IP using SETUPIP on BX-P-ECOMEX
Post by: BobO on February 01, 2024, 02:12:57 PM
Well that ain't good.
Not ideal anyway ;)

I was really thrown by the "panic" error, but now that I realize what I did that error from the CPU makes perfect sense.

I would prefer that we handle it more gracefully, but SETUPIP triggers some pretty critical things. If that got reentrant not much good will come from that. The 'panic' is a handler in the TCP/IP stack that gets invoked when things have gone very wrong, and apparently firing that off a second (or third, or fourth, etc) time got the stack out of shape.

Sorry for the trouble.
Title: Re: Setting IP using SETUPIP on BX-P-ECOMEX
Post by: MarkTTU on February 01, 2024, 03:29:07 PM
Well that ain't good.
Not ideal anyway ;)

I was really thrown by the "panic" error, but now that I realize what I did that error from the CPU makes perfect sense.

I would prefer that we handle it more gracefully, but SETUPIP triggers some pretty critical things. If that got reentrant not much good will come from that. The 'panic' is a handler in the TCP/IP stack that gets invoked when things have gone very wrong, and apparently firing that off a second (or third, or fourth, etc) time got the stack out of shape.

Sorry for the trouble.

No trouble at all. I've spent way more time chasing my own idiocy on this project than would warrant getting upset at the 15 minutes I spent beating my head against my desk on this one ;)