Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - garysdickinson

Pages: 1 ... 3 4 [5]
61
Technical support / Nano-10 DATE[3] Undocumented Behaviors
« on: April 09, 2011, 10:00:59 PM »
In studying the example PC6 file, "TimeServer", I noticed that the programmer set DATE[3] (day of month register) to a value of 0 to back up the RTC year, month, day registers.  

The end result, is that the RTC DATE[1], DATE[2] and DATE[3] registers will be backed up to the last day of the previous month.  The year register may also be affected.

The following TBASIC code:

???DATE[1] = 2012
???DATE[2] = 1
???DATE[3] = 0???

Will program the RTC to 12/31/2011. This effectively backs the RTC up one day.  The TBASIC programmer doesn't have to worry about the number of days in each month.  I haven't tested it for leap year behavior.

Programming the DATE[1] register with values less than 0 appear to advance the date way into the future.  Negative numbers are not handled well by the PLC firmware.  This is not a problem.  Backing up by a single day is perfect.

I did a little work and discovered that If I program DATE[3] to a value greater than the maximum days possible for the current month and year will advance the RTC year, month and day registers.

The following TBASIC code:

???DATE[1] = 2011
???DATE[2] = 12
???DATE[3] = 32???' There are 31 days in December...???

As there are only 31 days in December, this will advance the RTC to one day beyond the last day in December. The RTC will be programmed to 1/1/2012.

In the previous example, if DATE[3] is programed to 33, this will advance the RTC by 2 days.  There is a bit of a pattern to
this...

OK.  Also very cool.  

This functionality is very useful, nearly indispensable when attempting to set the RTC for local time using an external time server such as NIST.  The NIST server provides time but it is in UTC and there are many cases where the local date is either ahead of UTC or behind UTC by a single day.

It might be nice to formally document these behaviors.  I suspect that the DATE[3] behavior exists in most of your PLCs.  I only have access to a small sample of your products.

The simulator in TriLOGI V6.40 does not emulate these RTC behaviors.

In the spirit of full disclosure, are there any similar undocumented math capabilities in the TIME[] registers?

I ask this because there are a few places crazier than California.  There are a lot of spots in the world that local time is not on hour boundaries. Adelaide Australia is +9:30 away form UTC... and they're only a little crazy!

Thanks for letting me rant.

Gary D.

62
Technical support / Trilogi V6.40 Build 02 I/O Shift issue
« on: April 07, 2011, 01:55:29 PM »
I just started using V6.40 build 02.  I noticed in the notes on the download page that the problem with shifting I/O up/down in the I/O Table had been fixed with custom functions.

It may have been "fixed" but it is now broken.

I find that with this version that if I have 2 custom functions:

  1-ConnectNIST
  2-ReadNIST

Then highlight "1=ConnectNIST", right click and select "Shift I/O Down" then I get the following:

  1-
  2-ConnectNIST
  3-ReadNIST

Everything is correct! The labels and the custom functions moved down.  Custom function #1 is blank.  

Now I create the name and contents for the new custom function #1.  I'll call it "NewFunc".

Now if I highlight "1-" (new empty custom function), right click and select "Shift I/O Up", things go wrong.  

The I/O labels are shifted Up correctly, but the contents of the custom functions are not 100% correct:

This is what I see after the shift up:

1-ConnectNIST <- Contents of  previous 1-NewFunc  WRONG!!! I/O label was moved, the OLD custom function code has not been overwritten.

2-ReadNIST <- Contents of  3-ReadNIST   I/O labels are correct.  Everthing is CORRECT!!!

I believe that the code that moves the contents of the custom functions "UP" does not start at the right point in the array (or list) of custom functions.

Gary Dickinson

63
Technical support / T100MD+ High Speed Counters
« on: October 11, 2009, 09:37:02 PM »
I attempted to interface a mechanical rotary encoder to a T100MD+ PLC.  The goal was to use the encoder for a simple input control for PLC based project.  Just one knob and one or two external push button switches.

These encoders are typically used as volume controls on car radios and many other consumer devices.  The encoder that I was using is a EVQ-WTE series encoder manufactured by Panasonic.  The encoder act just like typical 2-bit quadrature encoders with A/B outputs that are out of phase by 90 degrees.   The encoder has 30 mechanical detents for each revolution of the knob but only produces 15 complete output cycles.

The encoder waveforms look like this:

            +----+----+------ Mechanical Detent
            |     |     |
            V     V     V        
      ---+     +----+     +---
  A      |     |     |     |
         +----+     +----+

         ---+     +----+     +---
  B         |     |     |     |
           +----+      +----+
              ^         ^
              |         |
              +--------+------ HSC counts here

  A/B Phase relation for C.W. Rotation



I tried 2 different approaches to interface this encoder to the PLC:

1.  Ladder logic.  This failed because the "debounce" logic used for the PLC INPUT circuits limits the speed that the the encoder can be operated and the ladder logic scan time is a  too slow to catch all of the transitions on the A/B inputs.

If the knob is turned quickly at a speed of about 1 RPM the phase difference of A/B can be as little a 2.5 ms.

I used the following ladder logic.  I used a Sequencer because it is easy to initialize to a value of "0" without having to use a custom function.


 |
 | 1st.Scan                              Seq1:0
 +-----||--------------------------------[StepN]
 |
 |     A                                  CLKA
 +-----||--------------------------------[dDIFU]
 |
 |      A                                 CLKAN
 +-----|/|-------------------------------[dDIFU]
 |
 |    CLKA     B                          Seq1
 +-----||-----|/|---+--------------------[Upctr]
 |                   |
 |    CLKAN   B      |
 +-----||-----||----+
 |
 |    CLKA    B                           Seq1
 +-----||-----||------+-----------------[Cnctr]
 |                    |
 |    CLKAN    B      |
 +-----||-----|/|-----+
 |
 |


2. High Speed Sequencer.  Using HSCDEF 2,2,32000 in a custom function and connected the A and B phase signals to input pins 5 and 6.

The high speed sequencer only counts on the positive transitions of the A phase.   As a result, for every two clicks (mechanical detents) on the encoder the HSCPV[2] will count up/down only one time.  

The good news is that the HSC mechanism is fast enough for my low speed counter application.  Unfortunately the HSC only counts 1/2 of the time!

3. My next experiment is to use both HSC #1 and HSC#2 to connect to the mechanical encoder.  I will connect the encoder A/B inputs directly to HSC #1.  I will connect inverted versions of A/B (ULN2003?) to HSC #1.  I will then use a custom function to calculate the total count T:

    T = hscPV[1] + hscPV[2]

QUESTION  1:

Is there a mechanism to configure the High Speed Counters for the M series of the F series to count on both transitions of the A phase?  Look at my ladder logic for an example of how this is done.


QUESTION 2:

Do you have any other suggestions on how to get a low speed quadrature encoder to work with your PLCs?

QUESTION 3:

Is there some easier mechanism for me to draw waveforms on your YaBB system?  I change the fonts to "Courier" but your BB system has issues with ASCII spaces (0x20) and does not treat them as having the same horizontal width as other printable characters.  This makes it impossible to do nice ASCII artwork.

Thanks,

Gary D.

64
I'm attempting to use the READ file service provided by TLServer V3.15

I'm using an old T100MD+1616 r42 PLC.  I'm using the XServer to conenct the PLC's RS-232 to ethernet.  I'm using TLServer V3.15.  The PC is running Vista (32bit)

I've created a ASCII file that contains two lines of text that are terminated with CR/LF pairs:

    01 Text<cr><lf>
    02 Text<cr><lf>


The READ command returns the following:

    01 Text02 Text<OK><cr>

I have used both INPUT$(1) and INCOMM(1) commands to verify this behavior.

What I see is that ALL line termination characters are stripped from the text file.  I understand that the "<OK><cr>" is the acknowledgement string from the TLServer.

This behavior is not what is documented in TLServer "Help":

Upon receiving this command and if the specified [filename] is successfully opened, the TLServer will begin sending all the ASCII characters contained in the text file to the PLC. Note that line breaks in a text file are sent to the PLC as CR character only and not as a CR+LF pair. As such, your PLC program can easily use the INPUT$(1) command to read in all the CR-terminated text string one string at a time and then interpret or convert the data as necessary. After sending out the last byte in the data file to the PLC, the TLServer will send a CR-terminated acknowledgement string "<OK>" to the PLC to signal that the READ command have been properly completed.


65
Technical support / Set/Clear of RTC.ERR
« on: February 18, 2009, 10:50:47 AM »
Is there a way to set/clear the RTC.ERR using ladder logic or custom functions? I'd like to clear this bit after setting the TIME[] and DATE[] variables.

I notice that the RTC.ERR bit is cleared via the "Set PLC's Real Time Clock" diaglog in i-TRiLOGI.

I can load the TIME[] and DATE[] with correct time/data info by use of the <READ RTC> NS command.  The writing o the TIME[] and DATE[] values does not effect the RTC.ERR status.

Ladder logic can use "RTC.ERROR" as a contact but cannot use this bit at the end of the logic as a COIL (output, relay, ...) nor can it use "RTC.ERROR" as the target for a functions (latch/clear/Reset).

66
Technical support / TLServer File Services and On-line Monitoring
« on: February 09, 2009, 10:19:35 PM »
I'm working with T100MD+1616 hardware and would like to log PLC data to a PC using the TLServer and the <APPEND xxx.txt> mechanism.

The problem that I am having is that I'm using the same COMM #1 port for both debug (online monitoring) and the <APPEND xxx.txt> activity.  It believe that the data streams for the <APPEND xxx> file services are getting intermixed with the On-Line Monitoring requests to "see" what's going on with the PLC.

The TLServer help files state:

The TLServer will close the file after it receives the end-of-service tag "</>" from the PLC and it will in turn send a "<OK>" tag to the PLC to acknowledge that the APPEND  request has been successfully completed. It is up to your PLC program to check for the "<OK>" tag to determine if it the service it requested have been completed successfully.

The Help file gives no suggestion on how the PLC program should check for the "<OK>" tag.

I use the following code to read the <OK> tag I really mess up the On-Line Monitoring:

' Get Response from TLServer
'
A$=""
N=0
I = INCOMM(1)
WHILE I<>-1
    A$=A$+CHR$(I)
    N=N+1
    I = INCOMM(1)
ENDWHILE

Is there a special (correct) way to check for the "<OK>" token?

Is the <OK> tag buffered differently from the commands send/received as a result of the On-Line Monitoring?  Is there a special TLBasic function that I should use?

Would I have less problems if I used the XServer rather than the RS-232 connection?

67
Technical support / Use of MDS100-BW and I-7017 on same RS485 port?
« on: February 07, 2009, 06:14:16 PM »
I've got a I-7017 connected to an T100MD1616+ PLC.  I'd like to add the MDS100-BW to the same RS-485 port.

Can the MDS100 co-exist with the I-7017 on the same RS-485?

68
Technical support / Launching TLServer 3.15
« on: January 30, 2009, 12:41:24 PM »
I'm having difficulties getting the TLserver 3.15 to run.  The TLServer window fails to open.

I'm running Windows Vista SP1, JRE 6.11.

I was running TRILOGI 6.14 w/JRE 6.03 before installing TRILOGI 6.21.

If I execute the tlserver3.bat from a DOS window, this is what I see:

C:\Program Files\TRiLOGI\TL6>java -jar TLServer31.jar

String counts = 83
Installation Directory = C:\Program Files\TRiLOGI\TL6/
Serialio Library: version 9.9.9: build 9191
Copyright (c) 1996-2008 Serialio.com, All Rights Reserved.
os.name="Windows Vista"  os.arch="x86"
TRi Amendment1:OS Name =Windows Vista
SerialPort class loaded: jspWin
Serial ports reported by system:
COM1;COM3;fsdir = C:\Program Files\TRiLOGI\TL6/FileService/
Getting Server IP addresses from O/S
IP Address1 = gary-PC/10.0.0.6
IP Address2 = gary-PC/fe80:0:0:0:4432:c14c:a57:df19%8
IP Address3 = gary-PC/fe80:0:0:0:1c18:ca2:f5ff:fff9%9
IP Address4 = gary-PC/2001:0:4137:9e50:1c18:ca2:f5ff:fff9
java.lang.NullPointerException
java.lang.NullPointerException
             at TLServer31.TlServer.a(Unknown Source)
             at TLServer31.TLServer.<init>(Unknown Source)
             at TLServer31.TLServer.main(Unknown Source)


Any thoughts on how to proceed?

69
Technical support / Trilog 6.21 Printing of I/O Tables
« on: January 26, 2009, 03:28:20 PM »
Will there be an option to reduce the font size (or use a fixed pitch font) when printing I/O tables?  

Long, but legal, names do not fit into the columns and overlap with the next column.

Example, "F1Key_EDGE" as a Input name will print across both the Inputs and Outputs column.

Pages: 1 ... 3 4 [5]