Major system error
I'm getting a "C10580: Internal Error: Major system error occurred during code generation" when compiling. I've determined it to a switch case that I added. I comment the particular case out and it is happy.
Anyone see problems with this code within a function?
cTEMP_GAME is declared as: CHAR cTEMP_GAME[10]
SWITCH (cTEMP_GAME)
{
CASE 'FO':
SEND_COMMAND dvTP_SCORES,"'^BMF-',ITOA(380+nMENU_COUNT),',0,%TFinal-OT'"
}
Thanks for the help in advance!
Comments
-
I don't see anything wrong there. You might want to post the rest of it as well.
Paul -
There are 2 situations that I know of that will cause a major system error.
1) A single character CASE above a multi character CASE (which I assume is your issue.) So if you have something like this:CHAR cTEMP_GAME[10] SWITCH (cTEMP_GAME) { CASE 'A': SEND_COMMAND dvTP_SCORES,"'^BMF-',ITOA(380+nMENU_COUNT),',0,%TFinal-OT'" CASE 'FO': SEND_COMMAND dvTP_SCORES,"'^BMF-',ITOA(380+nMENU_COUNT),',0,%TFinal-OT'" }
You’ll need to change it to this:CHAR cTEMP_GAME[10] SWITCH (cTEMP_GAME) { CASE 'FO': SEND_COMMAND dvTP_SCORES,"'^BMF-',ITOA(380+nMENU_COUNT),',0,%TFinal-OT'" CASE 'A': SEND_COMMAND dvTP_SCORES,"'^BMF-',ITOA(380+nMENU_COUNT),',0,%TFinal-OT'" }
2) Two functions with the same name.
If anyone knows of any other ways to cause a major system error, this would be a good thread to post it in. -
A single character CASE above a multi character CASE
You nailed it! Who would of thought??? Putting the multi-character cases first...
Is there a reason behind that or is it just a bug in NetLinx Studio?
Thanks for the help. It's compiling now!
-
I believe that the compiler will try to type cast all case values based on the datatype of the first statement. In your case (so to speak) attempting to cast a character array back to a single character confuses it somewhat.
-
Possible alternative
SWITCH ("'@',cTEMP_GAME") { CASE '@A': SEND_COMMAND dvTP_SCORES,"'^BMF-',ITOA(380+nMENU_COUNT),',0,%TFinal-OT'" CASE '@FO': SEND_COMMAND dvTP_SCORES,"'^BMF-',ITOA(380+nMENU_COUNT),',0,%TFinal-OT'" } -
End of line - Major system error
I don't remember the specific error but "Major system error occurred during code generation" sounds like the error I've seen was cause by a copy/paste error. The End of Line characters (CR LF) only had a CR or LF instead of both. To find it select the "Show End of Line" option in NetLinx Studio and looked for the bad EOL. Hope that helps someone. -
Anyone know where one can set this "show end of line" option?
-
Never mind. I used Sublime text to check the line endings. They were fine.
But I got rid of this error, somehow, by rearranging definitions and trying this & that. No idea of the cause. I had no SWITCH in the module.
-
Also happens when you have two function definitions with the same name. Simple copy/paste mistake. Weird that the compiler isn't smarter about that.
The setting for 'show end of line' is in menu: 'edit ' > 'advanced'.
-
It's been a while since I've done some NetLinx code and I ran into this. I chased my tail for a good 20 minutes.
define_device dvRoku = 00000 : FIRST_LOCAL_PORT + 1 : 00; // Don't do that...
-
I've just started learning to program in Netlinx, and the first code I knocked up and compiled resulted in this error, first time round.
I was using Netlinx Studio on Windows 10, through VirtualBox on a Mac. But when I transferred to a PC, running Windows 10, it compiled no problem. Same code, no changes. -
This is one of the more frustrating compiler error messages. No guidance to a line number or further descriptive messaging to point you into a direction. I encountered one recently when I inadvertently pasted a function declaration twice. In general, it is code related and block comment/uncomment is typically how I try to chase these issues down.
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums
