Author Topic: Program Errors  (Read 10129 times)

NSPA

  • Guest
Program Errors
« on: June 30, 2006, 07:32:47 AM »
I am having problems with custom functions. I can write a function and then compile it and it will be fine. I can then compile it again and it will throw a TYPE MISMATCH error. The way that I have it written works. What is the deal? Software or me?

The following is the line that i get the error on. The   A$   is what the program highlights as the error.

HSCDEF 1,11,A$

Error:  Type Mismatch (numerics/strings may not mix)

If this is "wrong" why will it work sometimes but not others?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Program Errors
« Reply #1 on: June 30, 2006, 12:22:36 PM »
HSCDEF only takes numeric parameters. A$ is a string variable. You must convert it into numeric term. You can use the VAL or HEXVAL function to do the conversion.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS