Author Topic: TBasic problem...  (Read 13236 times)

Jane

  • Newbie
  • Posts: 10
  • I'm a llama!
    • View Profile
TBasic problem...
« on: October 18, 2007, 12:23:13 AM »
Hello.....

I need to periodically sample read the input chanel  value into some Strings(A$ to $Z)......In TBasic

E.g. every 0.5s, run the following function in TBasic:

   A$=input[1]
   B$=input[2]
   .......
but it's wrong

I can't fine in the manual  
I want to know  TBasic cause that RVS0101


And

In visual basic program with xserver.......

I send any host link command such as "@01RV$D25*" and there will be the response as "@01RV$00061*"  from the PLC. Can I know variable name in the response as "@01RV$00061*" .....
it is not variable name In "@01RV$00061*" ..
« Last Edit: October 18, 2007, 12:34:51 AM by Lim Jeong Ran »

FQ-ONG

  • Jr. Member
  • Posts: 61
    • View Profile
Re:TBasic problem...
« Reply #1 on: October 18, 2007, 03:40:19 AM »
From E.g. A$=input[1]
$ missing
[1] should be (1)

A$=INPUT$(1)
« Last Edit: October 19, 2007, 03:36:57 AM by FQ-ONG »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:TBasic problem...
« Reply #2 on: October 19, 2007, 10:15:40 AM »
What do you mean by "input channel"? Do you mean serial input, or digital inputs or analog inputs?

Note that if you are using a PLC's comm port for programming and online monitoring, then that comm port buffer will be filled with host  link commands sent by the TRiLOGI software and when you subsequently use the INPUT$(1) to read the serial port #1 you will get a lot of these host link command strings. If you are disconnecting the PC or Xserver from the PLC's comm port in order for it to connect to something else (e.g. barcode reader) you should execute a loop of INCOMM(1) until it returns -1. This ensure that the buffer is cleared before using it for interfacing to other devices.

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