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 - Lorne Van Dusen

Pages: 1 ... 4 5 [6] 7
76
Technical support / Re:Creating a FIFO
« on: February 16, 2017, 02:38:14 PM »
Gary I really appreciate the quick turn around for your response on this subject.
I created a Custom Function (FIFO) that is called from the rising edge of relay 146
So when a message is created and stored into A$ the relay 146 is turned on
I then inserted your sample program into the Custom Function & removed your Call DequeueMsg
I then included #   #Define Name   Value
1   ENQ_Offset      DM[1700] // DM1700 to DM1800 not used anywhere else
2   DEQ_Offset      DM[1701]
3   FIFO_Cnt         DM[1702]
4   FIFO_Size         15
5   FIFO_StartAddr   10

Also I changed your B$ to E$ as I was already using B$
When I run the simulator and Type in a message into A$ then I trigger Relay 147 nothing happens
I tried it many times and the value in FIFO_Cnt never changes
I see you use an Old Version of software and use ' for Rem Statements I found using the // makes the program easier to read. Can you please look over the program below & let me know where I went wrong.
Also when it is working how can I read the Stored Messages?

Actual program
// This function is used to store the latest 15 Fault Messages the the PLC has detected.
// This Custom Function was created with the expert help from GARRY DICKINSON

// EnqueueMsg - function to enqueue an array of 40 character messages into the Message FIFO

// On entry A$ holds the string to enqueue
// This FIFO uses the SAVE_EEP$ statement to store data in the non-volatile memory.
// The message length is limited to 40 characters

// On exit: The A$ will be written to the FIFO
//         The FIFO_FULL and FIFO_EMPTY RELAYS may be affected.
//        The DM[] variables ENQ_Offset, DEQ_Offset and FIFO_CNT may be updated.
//         If the FIFO is full then the E$ variable will be written with
//           the oldest message in the FIFO to make room for the new message


//  If the FIFO is FULL, then discard oldest message in the FIFO

IF TestIO(MsgFifoFull) // the FIFO is full so we will discard the oldest to make room for the newest message.
                     // This action will overwrite the value of E$
   
ENDIF

SAVE_EEP$ A$,FIFO_StartAddr + ENQ_Offset   // Write one entry into the FIFO      

                                 // Update the FIFO index, counter and flags

ENQ_Offset = (ENQ_Offset + 1) MOD FIFO_Size
FIFO_Cnt = FIFO_Cnt + 1

IF FIFO_Cnt = FIFO_Size
   SetIO MsgFifoFull         // the FIFO is full and cannot accept more data
ENDIF

ClrIO MsgFifoEmpty           // FIFO cannot be empty


// This is the entire custom function to enqueue a string in the FIFO:
// Code:

// DequeueMsg - function to dequeue String data from the String FIFO

// On exit:  E$ will hold the oldest string in the FIFO.
//        The FIFO_FULL and FIFO_EMPTY RELAYS may be affected.
//        The DM[] variables ENQ_Offset, DEQ_Offset and FIFO_CNT may be updated.


// Return message from FIFO in E$
 
IF TestIO(MsgFifoEmpty)
   // the FIFO is empty and there were no values to remove from the FIFO
   // Just return a NULL String
   //
   E$ = ""
ELSE
   // the FIFO was not empty, so return oldest message in E$]
   
   E$ = LOAD_EEP$(FIFO_StartAddr + DEQ_Offset)

   // Update index, FIFO count and flags
   
   DEQ_Offset = (DEQ_Offset + 1) MOD FIFO_Size
   FIFO_Cnt = FIFO_Cnt - 1

   IF FIFO_Cnt = 0
      SetIO MsgFifoEmpty   // the FIFO is empty and there is no more data to remove
   ENDIF

   ClrIO MsgFifoFull        // FIFO cannot be full
ENDIF

77
Technical support / Re:Number being forced into DM[1036]
« on: February 15, 2017, 07:55:05 AM »
Gary you are a Genius
I kept looking at the 9080 and said I know that number I have used it a few times in the past.
As soon as I read your reply it struck me that yes I did leave a old piece of program that I forgot to delete.
GET_IPAddr 1032 // Get the PLC "IP" address and "Port" number
The strange thing is that there was no DM in front of the 1032 once I removed the statement I was finally able to clear the unwanted value in DM[1036]

Thanks again for you expert advice.

Regards
Lorne Van Dusen  

78
Technical support / Re:Creating a FIFO
« on: February 15, 2017, 06:22:17 AM »
Gary somehow I knew it would be you that answered the question.
I totally understand the concept of a FIFO First in First Out. I don't care if the oldest message gets lost.
The easiest way to explain what I need to do is this. Even though I am using a Text display I cannot use the built in Alarm function as the text display is not normally connected to the plc. it is only connected when the mechanic comes along for service or to repair a shut down then when they are finished they take the display with them as it is used as a tool.
What I need to accomplish is a way of storing say up to 15 (up to 20 Character Long Messages) that can be retrieved either by logging into the PLC and viewing them or by retrieving them and viewing them on the text display.
I can create multiple screens in the text display that will show the messages in order. Or I can use one screen and increment or decrement a counter to move the various messages into the same variable message.
The message to be moved into the FIFO will be A$
However I have the problem of that I have already used up most of the Variable strings A$ to K$ as well as W$ to Z$ so I actually don't have 15 spare variable strings.

Regards
Lorne :D

79
Technical support / Creating a FIFO
« on: February 14, 2017, 01:19:06 PM »
I have a message that is stored in A$ that I need to put into a FIFO
 I only want to put the Message into the FIFO each time Relay 46 turns on.
I am hoping that the message in A$ can be moved into a DM area starting from DM[1700] or can a Text Message only be stored in a Variable such as A$?
I have a sample of how a FIFO should be done but I am still a little confused, Especially with the DM[1]
In the Define Table FIFO_Size = 15
 IF DM[21] <> DM[22]
DM[22] =DM[21]
 // Start FIFO
FOR I = 1 to 16 // Shift old data by towards end of FIFO
  LSHIFT DM[1], FIFO_Size
NEXT
DM[1] = DM[21] // Add new word to beginning of FIFO
ENDIF

In My program the Message is stored in DM[1600]
The start of the FIFO is DM[1700] so I think that DM[21] in the sample would be my DM[1700] & the DM[22] in the sample program would be my DM[1701] does that mean I need to substitute DM[1] with my DM[1600] ?
In my actual program DM32[1] is where the HSCV is stored.


80
Technical support / Re:Found bug in FlexSoft
« on: February 14, 2017, 09:24:38 AM »
This issue seems to be resolved.
I deleted the screen that was using the 2 buttons pressed then made a new screen from scratch and now it seems to work properly. Both buttons need to be pressed then released and the released task works. If only one of the buttons is pressed then released nothing happens which is the way it is supposed to work.

81
Technical support / Number being forced into DM[1036]
« on: February 14, 2017, 09:20:25 AM »
I am using a FX2424 and cannot find out why DM[1036] always shows a value of 9080
All the DM32 addresses used only go as high as DM32[242] and my lowest standard DM's start at DM[500] so there should be no overlap.
When I view it DM[1036] has no name and when I search my program DM[1036] can't be found.
When I view it in 32 bit DM[518] it shows no name and it has the same value of 9080 and doing a search for DM32[518] shows no results.
How can I find where this value is being placed into DM[1036]  

82
Technical support / Found bug in FlexSoft
« on: February 10, 2017, 05:17:06 PM »
I am concidering this as a bug due to the actions of the properties.
When you chose two buttons together to cause an action during buttons pressed every thing works perfect.
However under released tasks it only looks at either of the buttons not both.
Example 2 buttons pressed F1 & F4 set bit
Press just F1 or F2 nothing happens however when you press and release either F1 or F2 and release the task set in released takes effect.

83
Technical support / Missing Screen Numbers in Flexsoft
« on: February 02, 2017, 02:55:01 PM »
Flexsoft Software
I noticed today when I was trying to move some screens and to add some more screens that even though at the top of the page it shows \SCREENS\SCREEN "Number"
However in the screen property window on some screens there is no screen number which means I can't change the screen number.
Does anyone know how to put a screen number into the screen properties? It is a lot of work to delete the screen then to redo it on a new screen.  

84
Technical support / Re:FP403MR with FX2424
« on: January 31, 2017, 02:00:02 PM »
Once you figure out the difference between the FP4030MR and the TRI-PLC everything works smoothly.
One small quirk you may or may not run into is that if you use lots of screens like I do you will need to separate the screens that the PLC calls and the screens that the Text display calls.
Not everyone uses text display the way I do so I will try to explain it in simple terms.
Because we do not permanently attach the text displays to the finished product but use it as a tool for our dealers to be able to adjust parameters that we allow the to adjust as well as use it for trouble shooting purposes. I therefore cannot use the standard Alarms so when ever the test display is plugged in and an alarm occurs the plc switches the screen to our alarm message page. To do this you need to move the value of the screen into the screen trigger register of the text display. Also I have it set up so that when you press two buttons at the same time the screen will switch to our start of the setting screens. To do this I set a bit in the PLC when ever the buttons are pressed to block out the PLC from changing the value in the screen trigger register and now the individual screens change the screen trigger register.
Then at any time someone presses the ESC key I reset the bit that was original set and the screen switches back to the main screen then resets the ESC bit.
Other than the original addressing quirks I mentioned I found the FP4030MR very easy to work with and it has a lot of good features.
If you have any other questions regard the FP4030MR let me know and hopefully I can answer them. After all old guys have to help each other out :D

85
Technical support / Re:FP403MR with FX2424
« on: January 27, 2017, 11:38:36 AM »
Gary are you really an old guy like me? In the old days I would have been forced to retire 2 years ago.

As for the numbering systems I totally agree. It really doesn't matter if we start from 0 or 1 as long as we are consistent. The frustrating part is when you are connecting 2 different devices and they both have different terminology. Bits in one are 0 to 7 and bits in the other are 1-8 it just makes it easier to make mistakes that you have to spend time figuring out.

As for the 8 bit addressing in the 4030 I also was quite surprised, I was using text displays more than 10 years ago that were 16 bit. My first thought when I started to use it was that TriPLC made a deal to take over and modify an old design text display to sell with their products.

Overall though the FP4030 is a nice looking display with lots of usable features and even in low quantity pricing it is in a good price range for what it is capable of doing.

My number one complaint is that you need to supply it with a separate cable to plug into the comm port and a different cable for the required power supply. I was used to a OMRON display that did not require a separate power connection

86
Technical support / Re:FP403MR with FX2424
« on: January 27, 2017, 07:21:54 AM »
Gary I was very impressed with your replay.
What I was doing was dividing the PLC address by 8 then I would at least get the main addressing of the relay inside the FP4030MR but I was always off by 1.
After I read your response it finally hit me that the text display starts at 0 and the PLC starts at 1.
I was very surprised that the TRIPLC starts at address 1.1
When I first started learning the ins and outs of the TriPLC I struggled with the fact that all their addressing starts at 1 and not 0 like most other manufactures DM0, Input 0.0, Output 0.0
 

87
Technical support / Re:PLC Dynamic IP Address
« on: January 12, 2017, 10:58:28 AM »
Thanks a lot
I just found this reply today I guess I forgot to check off to notify me.
I tried your example and it works perfectly.
What I needed this for is that I intend on providing our customers with physical disabilities a web app for their phone or tablet.
So to make life simple for our dealers I needed a simple way for them to find the assigned IP address which I now will show on one of the screens in the FP4020MR text display.
 :D

88
Technical support / FP403MR with FX2424
« on: January 12, 2017, 10:02:55 AM »
I am still confused about the correct addressing inside the MD4030 MR when it comes to internal relays and input and output on the FX2424
Whit some trial and error I found that RC00059.00 actually turns on Relay 473, RC00059.01 turns on Relay 474 and so on.
Is there a simple formula that I can use to figure out a faster way to get the address correct?
Example what would be the correct IC number in the FP403MR to turn on Input 17 on the PLC?
What formula to use to figure out what RC number to trigger say Relay 146 inside the PLC?

89
Technical support / PLC Dynamic IP Address
« on: January 05, 2017, 12:43:14 PM »
I am wondering if there is any way that the PLC can shown what Dynamic IP address it is given say from a router.
The PLC IP address was set as 0.0.0.0 in order to allow for a dynamic address.
So when you do a GET_IPAddr 100 of course you will see 0 0 0 0 9080

90
Technical support / Re:great suggestions for the Define table
« on: January 05, 2017, 08:36:49 AM »
I was looking over questions posted in the Forum and came across this post.
As a long time PLC user I found that it was a little frustrating that the Define Table did not have a column to allow for a description as most PLC software always allows for a description in their Symbolic File.
This would be a great feature for TriPlc to add to their software.
In the mean time I exported the file into Excel and made a column where I added the descriptions and keep the printout close by when working on the program.  

Pages: 1 ... 4 5 [6] 7