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.


Messages - garysdickinson

Pages: 1 ... 23 24 [25] 26 27 ... 34
361
Technical support / Suggested Enhancement for i-TRiLOGI
« on: February 11, 2013, 04:43:43 PM »
Over the years you have been adding things to i_TRiLOGI to improve the functionality and to improve the readability of the PLC code.

I really like the #define (pre-processor) mechanism, a lot.  

Since you added the ability to shift I/O names up/down in the I/O Tables this has had the unintended side effect of breaking code.

The access to Counter/Timer Set Values and Present Values can only support an integer constants or variables for the argument n:

GetTimerSV(n)
SetCtrSV(n)
TimerPV[n]

GetCtrSV(n)
SetCtrSV[n]
CtrPV[n]

It would be very nice if the "name" of the COUNTER or TIMER that is used in the I/O Table could be used in place of "n".  The TBASIC parser (tokenizer) allows both integer constants as well as integer variables for the argument "n".

This way if you wrote code that had a COUNTER named "EventCtr" that was physical counter #10 in the I/O table then you could access the present value of this counter in a custom function with code like this:

A = CtrPV[EventCtr]

rather than like this:

A = CtrPV[10]

I think that this would be pretty simple for your parser to handle.  You are generating a symbol table that relates names to I/O #'s because you can handle statements like:

If TestIO(EventCtr) ...  where EventCtr is a name in the I/O of a COUNTER.  The TBASIC parser (tokenizer) will accept integer constants, integer variables and symbols used in the I/O table as the argument "n".  See it can be done!!!

Because you have added the ability to shift I/O Table elements up/down it is very easy to break any custom function that uses

A = CtrPV[10]

If it could be written as

A = CtrPV[EventCtr] then the I/O shift would not break the code.  There is also a possibility that the code may be a bit easier to understand and maintain.

Part of what made me think of this is that I am working with your example program, "ExtendedFileSystem.PC6".  The custom function, ConnFTP,  has code that accesses the PV of TIMER #2.  This timer is not defined in the I/O table.  It is not obvious by looking at the I/O Table that this TIMER is being used at all.  It is equally mysterious when looking at this code with on-line monitoring when a TIMER with out a name wakes up and runs through values.  I do 100% understand what the custom is using TIMER #2 to accomplish.

Best Regards,

Gary D.

362
Technical support / Re:Variable name limitations
« on: February 09, 2013, 06:42:29 PM »
Cdenk,

Excellent work.  32 characters is pretty useful.

As you are figuring out the character set that you can use with the #define is fairly limited. This is as expected.  TBASIC does not use white space as exclusively as a symbol delimiter.

The following are equivalent:

A = b + c / e
A=b+c/e

This says makes +,*,<,>,=,^,|,-,",',$,(,),: definitely off limits.  All of the TBASIC function and statement names are off limits.

Anything that starts with a..z and the second character is a _ will will screw up the TBASIC parser.  This is a result of the "variable commenting" silliness.

/*  */  C comments will screw up stuff.

About all you have to make things readable is mixing upper and lower case such as FifoBaseAddress.  However, TBASIC, doesn't make any distintion with upper and Lowe case.  FIFOBASEADDRESS is the same as FifoBaseAddress.

You also must not create things with the #define mechanism that uses the same text pattern that you have used to define anything in the I/O Table.  Fortunately, you will get error messages for this.

Gary d

363
Technical support / Re:Variable name limitations
« on: February 06, 2013, 09:14:28 PM »
I haven't found a great answer for editing PC6 files.

The exported custom functions are exported using what I'd call UNIX end of line format. I have found editors that can cope with the end of line problems.  Simple windows editors like NotePad can't deal with the exported format.

To get the edited text back into the PC6 program I cut and paste between my text editor window and the iTriLog custom function editor window.

I also use the "find" and "find all" stuff in the custom function editor as a crude search and replace mechanism.

I wish I had a better answer,

Gary d


364
Technical support / Re:Variable name limitations
« on: February 06, 2013, 04:52:53 PM »
Cdenk,

TriLog hasn't documented the "rules" on the #define mechanism.

I've been using #define a lot. These are my recommendations:

Characters set to use: a..z and 0..1.  Upper and lower case characters can be used, but the iTrilogi software consider "ABCD" and "abcd" as the same symbol.

Character set to avoid: everything else.  Don't use the dash, "_" as this character really screws up Trilog's syntax highlighter.  They used the "_" character for the stupid "variable comment" idea.  In fact don't use a "_" for naming RELAYS, TIMERS and the alike because of the messy implementation of the "variable comment stuff.

I have not tested the maximum length a #Define symbol can be before it breaks their software, but I have used symbols as long as 16 characters.

You can use the #define to define a new symbol from symbols that were previously defined.  As an example:

#   Label Name          Variable
1  FifoBase                 100
2   FifoSize                 10
3  LastEntry                FifoBase + FifoSize


I use the #define to create easy to understand variables out of the DM[] memory:

#   Label Name          Variable
1  EnqIndx                 DM[1]
2  DeqIndx                 DM[2]
3  FifoCnt                 DM[3]


This allows me to create variables that are sort of "local" to a custom function.

Best of luck,

Gary d

365
Technical support / Re:Message display
« on: January 22, 2013, 08:36:32 AM »
I'm sorry, but I can not help you.

I think that your coding style has limited your options.

You might consider throwing more hardware at the problem.  Add another PLC to manage the display.  

I know that this adds extra cost to your project but if you can't change your coding style then a second PLC gives you the opportunity to manage the display of messages independently of the execution of your test sequence.

Gary d


366
Technical support / Re:Message display
« on: January 21, 2013, 11:42:49 AM »
I would suggest the use of a TIMER.

Gary d

367
Technical support / Re:Message display
« on: January 18, 2013, 02:47:10 PM »
I've attached a "zipped" version of the test code described in the previous post.

Gary D.

368
Technical support / Re:Message display
« on: January 18, 2013, 02:41:48 PM »
Let's assume that your test code sets/clears RELAYS to indicates the failure/success of each test.  Each test has it's own RELAY.

Now the displaying of error message is decoupled from the actual test.  This makes it very easy to control exactly how long messages are visible.

I wrote a simple PC6 file that only does the display.  The sample only supports 4 error bits and uses RELAY #1..#4 to represent the errors. You set/clear the bits using the on-line monitoring.

There are 2 custom functions involved. The first one sets up strings to display for each of the four errors and some varaibles
that are used by the ErrChk custom function.

' InitDisplay - code to provide one-time initialization for display mechanism
'
Save_EEP$ "Error 01", 1
Save_EEP$ "Error 02", 2
Save_EEP$ "Error 03", 3
Save_EEP$ "Error 04", 4

ErrMsgIndx = 1
ErrorCnt = 0
[/color]
This is the custom function that is called periodically to check for
errors that need to be displayed:

' ErrChk - function to display error messages
'
while (ErrMsgIndx <= MaxErrMsg)

???if TestBit(RELAY[1],ErrMsgIndx - 1)
??????' Error...
??????' Display message for this error
??????'
??????SetLCD 0,0,CHR$(1)??????' Clear Screen
??????SetLCD 1,1,Load_EEP$(ErrMsgIndx)
??????SetIO DispMsg
??????ErrorCnt = ErrorCnt + 1??????' Running count of errors

??????' Undate index into error bits
??????'
??????ErrMsgIndx = ErrMsgIndx + 1
??????if ErrMsgIndx > MaxErrMsg
?????????ErrMsgIndx = 1
??????endif
??????return
???endif

???' No error found at this index,
???'   Try the next index...
???'
???ErrMsgIndx = ErrMsgIndx + 1

endwhile

' If we got here then we have searched through
' all of the possible errors...
'
ErrMsgIndx = 1??????' Start over at the beginning

IF ErrorCnt = 0
???' No error messages posted on this pass
???'
???SetLCD 0,0,CHR$(1)??????' Clear Screen
???SetLCD 1,1,"No errors found"
ENDIF

ErrMsgIndx = 1??????' Start over at the beginning
ErrorCnt = 0??????'   With a fresh slate (no errors, yet...)??????
[/color]
At the end of this reply is the ladder logic that is required to get
the 5 second delay for displaying messages and the mechanism to call the custom functions.

Best of Luck,

Gary D.

369
Technical support / Re:Message display
« on: January 18, 2013, 11:06:47 AM »
OK.

Perhaps this approach might meet your needs:

1. You have a loop of code that executes a sequence of 50 tests.
2. This loop of code runs continuously from test 1..50 and just repeats, forever.
3. For each test there is a RELAY that is set/cleared based on the success/failure of that test.  If no test fail then no RELAYs are set.

If you have 1..3 working, then you just need a method to display
a message for each failure (RELAY bit that is set).  The message for each failure is to be displayed for 5 seconds.

Is this close?

I do have a few questions about how you have structured this code that performs 50 test:
1.  Do all of the tests execute on a single scan of the ladder logic?
2.  If the tests are distributed across multiple scans of the ladder
     logic do any of the tests use the DELAY statement?

Depending on how your code is structured, I may have a simple solution to your problem.

Gary D.

370
Technical support / Re:Message display
« on: January 18, 2013, 10:20:51 AM »
OK.

Let me see if I'm getting it.  

You want the sequence of tests to stop when an error is detected, display a message on the LCD and wait for a human to do acknowledge the error and then move to the next test in the sequnce.

Is this close to what you want?

Gary d

371
Technical support / Re:Message display
« on: January 18, 2013, 08:52:54 AM »
I'm sorry, but I do not understand the problem that you are trying to solve.

Can you explain what you are trying to achieve?

I understand that you are trying to test 50 different things.

Do you test all 50 things, save the results and then display messages only for those tests that failed?

Are all of your tests pass/fail?

Gary d

372
Technical support / Re:Message display
« on: January 17, 2013, 11:33:55 AM »
I will show you how to call a function once every 5 seconds.  This function will figure out what if any error message is to be displayed and display only one message.

In this ladder example, the CUSTOM FUNCTION, ErrorChk, has the following format:

' ErrorChk - custom function to display error messages
'
IF TestIO (Error01)
???SetLCD 0,0,CHR$(1)??????' clear screen
???SetLCD 1,1,"Error01 Problem"
???Return
ENDIF

IF TestIO (Error02)
???SetLCD 0,0,CHR$(1)??????' clear screen
???SetLCD 1,1,"Error02 Problem"
???Return
ENDIF

IF TestIO (Error03)
???SetLCD 0,0,CHR$(1)??????' clear screen
???SetLCD 1,1,"Error03 Problem"
???Return
ENDIF

IF TestIO (Error04)
???SetLCD 0,0,CHR$(1)??????' clear screen
???SetLCD 1,1,"Error04 Problem"
???Return
ENDIF

[/color]

The ladder logic for this simplistic example follows.  The COUNTER 5SecCntr has a set value of 5.

Gary D.

373
Technical support / Re:Message display
« on: January 17, 2013, 10:35:48 AM »
You can and should do the delay in ladder logic.

If the only job for your custom function is to display error messages, then you could call the custom function periodically.  If it takes 5 seconds for a human to read a message, then call your message display function once ever 5 seconds.


Gary d

374
Technical support / Re:iTrilogi Ver 6.45 build 3, Edit issues
« on: January 06, 2013, 05:30:26 PM »
Hello all.  You are very responsive to my rants.  I greatly appreciate the effort that you put into improving your software.

I have worked with the newly released Build 4 version and you have fixed most of the things that have made me a bit crazy.  

There are still problems with the management of custom function names.  I have attached a ".pdf" that illustrates that new custom function names are still not being correctly propagated to all instances of data structures that manage custom function names.

I also observed another problem with the custom function editor.  If you attempt to "View Other CusFn" you cannot view custom function #1.  Please look at the ".PDF" for this issue.

Gary D.

375
Technical support / Re:iTrilogi Ver 6.45 build 3, Edit issues
« on: December 27, 2012, 04:05:44 PM »
Let me clarify the issue with the Custom Function names.  What is happening is that changes made to the I/O table list of custom functions is not being correctly propagated to the list of custom functions that is shown within the custom function editor.  

I'm guessing that your code maintains multiple lists of custom functions names and that all instances of this list are not being maintained.

I have attached a ".pdf" file with screen shots that demonstrate how to reproduce this problem.  This problem exists with Java 1.4.2_19 and the recent Java 7.0.90.5.

On my attempts to copy using <ctrl>-C from the I/O Table.  The "blue" cursor was highlighting the label name.  In this mode the right-click only gets me the I/O shift up/down options.  If instead I select the RELAY name for edit, then highlight the name and then right-click a different menu opens and this menu has the copy option.  I think that my problem with this was mostly my own operator error problem.  


Best regards,

Gary D.

Pages: 1 ... 23 24 [25] 26 27 ... 34