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] 2 3 ... 7
1
Technical support / Re: Reading a string using MODBUS RTU
« on: March 06, 2023, 01:50:30 PM »
Now it works properly

2
Technical support / Re: Reading a string using MODBUS RTU
« on: March 06, 2023, 09:59:17 AM »
I must be missing something as i downloaded your latest version and ran it in the simulator and all I get is the value 32 in the DM[20] location.
All other DM's are blank

A$ = "OPEN EMERG STOP SW  "

J = LEN(A$)

FOR I = 1 to J
   DM[J] = ASC(A$,I)
NEXT

3
Technical support / Re: Reading a string using MODBUS RTU
« on: February 28, 2023, 11:22:10 AM »
I tried the program from tech support however it only showed a value of 20 in DM[1] which I guess meant 20 characters. Then I tried Gary's and all I got was numbers in DM[1] so something is wrong in both programs.
This is what I need A$ holds a maximum of 20 characters example: A$ = "OPEN EMERG STOP SW  " so if I am correct it would fill 10 consecutive DM's
so on simulation I should see values in DM[1] to DM[10] if there are two BYTES stored in each DM 

4
Technical support / Reading a string using MODBUS RTU
« on: February 24, 2023, 07:43:35 AM »
I have a third party device connected to a FX series PLC that uses the MODBUS RTU protical. The developer knows how to read the values of the Inputs, Outputs, Internal Relays as well as the DM values. However is there any way they can read what is stored in say A$?
The A$ will show a 20 character text message such as A$ = "OPEN EMERGENCY STOP " Can anyone tell me how they can read the contents of the A$ using MODBUS RTU commands?

5
Technical support / Re: PLC INPUT Interrupt Behavior
« on: November 08, 2022, 07:01:28 AM »
Gary I had had a similar issue and when I did some detailed testing I discovered that there was a 24VDC relay that was connected to a PLC output and the manufacture of the equipment forgot to install a diode across the coil. Be-leave it or not that spike created cause the PLC to call my interrupt that I used to reset the HSC value. 
I found out with some help from tech support that within the interrupt I could disable the interrupt then I could do a quick Refresh and read the input that was tied to the interrupt which now is at level logic then reset my HSC value then re-enable the interrupt . All this added less than 1ms which actually prevented the spike from resetting the HSC and was still more than fast enough to reset the HSC value instantly. 

6
Technical support / Re: PLC INPUT Interrupt Behavior
« on: November 03, 2022, 12:58:40 PM »
Gary
I think you have the right idea but you are over doing it.
Leave the Interrupt as a Rising Edge trigger then in the first line of the function disable the interrupt then do a REFRESH of the IO then do a TESTBIT of the input you want then you can set any relay you want or reset any counters etc.
Then before you exit turn the interrupt back on.
Then in your ladder logic you can reset the relay you set in the function any way you want

7
Technical support / Re: People Counter
« on: March 16, 2020, 02:00:22 PM »
 :) Gary I finally had some spare time to play with your program.
I am impressed with the way you did it in a state machine and how works.
However I am at a loss on how to determine an actual count value.

8
Technical support / Re: Bit Shift
« on: March 16, 2020, 01:37:05 PM »
Your explanation was perfect and the solution was simple
In my custom function i just used X = ? and I change the ? to the number of shifts I needed
example
X = 4 'To shift 4 bits to the left
FOR I = 1 to X
LSHIFT RELAY[1] 'I only needed 1 channel
NEXT

9
Technical support / Bit Shift
« on: March 09, 2020, 11:35:58 AM »
I was reading the tbasic manual and came across the LSHIFT & the RSHIFT. The explanation shows and example of LSHIFT as being LSHIFT ,n The i is a DM[n] or RELAY[n] etc then you can add a , and a number equal to the number of channels that you want to shift. So if you want to shift Relay channels 2 to four you would LSHIFT RELAY[2] , 3 so far so good. However if I want to shift just RELAY[2] by one bit I would use LSHIFT RELAY[2]. My question is what is the simplest way to shift left by 2 bits. Do you have to do LSHIFT RELAY[2] then again LSHIFT RELAY[2]
example LSHIFT RELAY[2]
LTSHIFT RELAY[2]
OUTPUT[1] = RELAY[2]
I would have thought that there would be a way to enter the number of shifts such as LSHIFT RELAY[2] ,1 for number of channels and a second , and the number of shifts.   

10
Technical support / Re: People Counter
« on: February 19, 2020, 06:54:28 AM »
Gary

 I didn't mean to make you lose any sleep over such a simple thing. I did the program to help beginners trying to understand Ladder logic programming without using the built in High Speed Counter. After all people don't move that quickly past the two sensors.

The whole concept of the program was to count the people as the entered the building and to make it as fail-safe as possible so if as they entered and only blocked the A pulse then backed up or even if the stopped at both A & B blocked it would drop back to the previous count the same is true for when you try to exit if you block the B pulse or even B & A then back up it will reset the count.
 
I totally understand you state machine concept however I cannot figure out how you can determine how many people have actually entered or exited or what the actual count is. You do have 4 separate counts 0 to 3 which seems to work if you always complete the sequence. However if you trigger A c =1 then trigger B c=2 then drop A c=3 then drop B c=0 However if you trigger A c=1 then B c=2  then drop B c=1 then drop A c still equals 1 so you have actually lost a count.

Now whatever you do don't lose any sleep over this and remember there is always more than one way to program any circuit.

Regards
The other Old Guy

11
Technical support / People Counter
« on: February 13, 2020, 09:11:05 AM »
I had some spare time and decided to show a simple people counter circuit that emulates an incremental encoder in a ladder circuit. I am hoping that this may help some new comers to help understand the use of ladder logic as well as some Basic.
This program shows how to store a DM32 set value as well as the DM32 count value into EEPROM and to move the stored value back into the original DM32 areas after the power comes back on. This may not be the most ideal way to count people or things but it does give an example of the use of edge triggered bits as well as latching relays and how to use a DM value as a up down counter.

12
Technical support / Example of a complicated ladder diagram
« on: February 03, 2020, 12:01:05 PM »
I figured that there must be some new comers that may be struggling with build more complicated ladder circuits so I have included a documented way of building such a circuit. I hope that this helps some new comers out there

13
Technical support / Re: 16 BIT TO 32 BIT
« on: January 24, 2020, 12:25:38 PM »
Thanks for resolving this issue.
I did not realize that I needed to reverse the position of DM[1] & DM[2]
My problem is that over the years there was no real standard for the order of which 16 bits was the least significant group of 16 bits betwee various PLC manuafactures. So I guess its save to say that if you look at say DM32[1] then the least significant group of 16 bits is DM[2] which correlates to DM32[1] = DM[1] - DM[2] in that order.

14
Technical support / Re: 16 BIT TO 32 BIT
« on: January 24, 2020, 06:38:24 AM »
Gary again thanks for the reply I had used DM[1] = RELAY[1] and DM[2] = RELAY[2] with the result being DM32[1] before I posted then I found out the problem is the simulator.
Do you or anyone else know how to solve the issue of the simulator stopping and causing you to have to close down the software and reboot only for it to work for another 5 to 1o minutes. This only seems to happen on the computer with Windows 10 I never experienced this on my computer with Windows XP

15
Technical support / 16 BIT TO 32 BIT
« on: January 23, 2020, 12:58:32 PM »
Is there a simple way to add two 16 bit values to make it into a 32 bit value.
Example I need RELAY[1]  and RELAY[2] to be a 32bit value instead of two separate 16bit values

Pages: [1] 2 3 ... 7