Author Topic: Compile/Download bug  (Read 11841 times)

evanh

  • Jr. Member
  • Posts: 59
  • y=A+B*(1-cos(2*Pi*x))
    • View Profile
Compile/Download bug
« on: November 11, 2005, 05:19:18 AM »
I'm not sure what's going wrong but having just written me first program for a T100MD+ I am a bit green on what's legal code and the procedure for downloading to the PLC.

What I've found is that using a custom function as an input bit in the ladder is not valid code.  A couple of interesting effects occur if one tries to do this:
 1 - The simulator compiles and runs without complaint.
 2 - The real PLC download doesn't even appear to attempt it's compile cycle and therefore doesn't send any code either.

So, apart from the discrepancy in the two procedures, there is no error or warnings produced by any of the compile runs.


Evan

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Compile/Download bug
« Reply #1 on: November 11, 2005, 11:49:17 AM »
Under normal ladder logic creation there is no way for you to make the custom function label name a contact bit in the ladder program because that's not the way the program works.

You probably had used the the "edit label" name to force this to happen and that't why the compiler did not detect the error.

The normal way is for the ladder program to trigger the custom function written in TBASIC. The custom function can change the ladder logic element's logic state by using SETIO, CLRIO, TOGGLEIO or by changing the system variables representing the I/O such as INPUT[n], OUTPUT[n], etc.

You can take a look at many examples in the

"c:TRiLOGI\TL5\usr\samples"
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Joel Moore

  • Full Member
  • Posts: 128
    • View Profile
Re:Compile/Download bug
« Reply #2 on: November 11, 2005, 01:38:30 PM »
I seem to be having a similar problem (although I never tried to use a custom function as a contact).

I made a number of changes to my program that mostly involved a lot of rearranging and renaming of my custom functions (I'm going to be turning the code over to other developers so I didn't want to present them with a confusing mess).  Now the program won't upload to the PLC yet if I just compile it I don't get any errors so I have no way of knowing what the problem is.

Here's a capture of what's being sent and received on the serial port when I try to transfer the program:

#05
#05
IR#0D
IR01*#0D
@01IR5A*#0D
@01IR015B*#0D
@01$v??????13*#0D
@01$vPS10*#0D
@01LT59*#0D
@01LT025602560512006400646016025617405D*#0D
@01VM5A*#0D
@01VMT100MD+r4962*#0D

Maybe that will make sense to someone there.

Here's a link to the project in case you can determine a cause from looking at it:

http://www.prodevinc.com/downloads/FlexPLC1.zip

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Compile/Download bug
« Reply #3 on: November 11, 2005, 03:46:48 PM »
It seems like the program transfer operation was interrupted by some unexpected problem probably caused by the Custom function renaming action. We will look into this problem and submit an update once the cause has been verified.
« Last Edit: November 11, 2005, 03:49:31 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Compile/Download bug
« Reply #4 on: November 12, 2005, 12:50:46 AM »
The problem with your program "FLexPLC1.PC5" is at circuit #3 where you use the labelname "HomeStart" as a contact. Since "HomeStart" is the labelname of a Custom function, it should not appear as a contact. Under normal circuit creation the TRiLOGI editor will not allow such a mistake to occur. I guess this error is probably introduced by using the "Edit Label" action.  If you correct this error the program will compile and program transfer will take place.

I guess when compiled for simulation the compiler somehow did not catch this error and let it pass through (it does not affect the program execution, just that "HomeStart" contact will never be turned ON that's all). But when compiling for program transfer there were more checks performed (such as checking for program size limits, I/O limits etc) and that is when the problem was detected and program transfer failed to proceed.

We will inform the development guys to address this issue for future releases, even though it is an uncommon problem that should not be encountered using normal programming. I guess the program should have caught this problem and issue a warning that a custom function label name has been used as a contact when it encounters such an error.
« Last Edit: November 12, 2005, 12:57:45 AM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS