Author Topic: Difficulty Troubleshooting Break Points  (Read 19744 times)

suhelens

  • Newbie
  • *
  • Posts: 2
    • View Profile
Difficulty Troubleshooting Break Points
« on: December 21, 2023, 02:30:55 AM »
Hi!

I have trouble debugging a breakpoint. I am trying to send to my machine via WRITEMODBUS function. Here is my code

DM[11] = 32808
DM[12] = 6399  //This is where the breakpoint occurs
DM[13] = 36647
DM[14] = 0
DM[15] = 0
DM[16] = 0
DM[17] = 0
SETSYSTEM 6,4
WRITEMB2 12,1,0,DM[11],7

What are some things to look out for at this breakpoint?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: Difficulty Troubleshooting Break Points
« Reply #1 on: December 21, 2023, 09:57:07 AM »
Did you set a breakpoint at the location you indicated in the comment? Or do you mean that you have encountered a runtime error that point to this location?

If you have intentionally set a breakpoint at your statement DM[12]=6399 then what are you trying to examine? You can view the value in the variable DM[11] executed in the prior statement to ensure that it has been assigned the correct value. I see that you wanted to assign it 32808, however, since all DM[] are 16-bit signed integers the numbers that it can contain range from -32768 to 32767. It won't be able to contain the value 32808.  It will instead overflow and becomes number -32728.

You can examine the value in DM[11] by hovering your mouse over it and it will display its value as shown in the picture below. Or you can use "On-line Monitoring" -> View Variable screen and scroll to the second screen where all the DMs are displayed to examine the value of DM[11].

--------------------------------------------------------------------------------------------------------------
If you have unintentionally set a break point there (it will be highlighted by a blue box around the statement) then you can remove the break point by clicking on the "Set Brk Pt" button to toggle it off as shown in the picture below. If you have uploaded the breakpoint to the PLC while doing online monitoring the PLC will stop execution at this statement and pause for your further action.

Alternatively you can also remove all break points from the "Edit-> Clear All Breakpoints" menu.

Email: support@triplc.com
Tel: 1-877-TRI-PLCS