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 4 ... 7
16
Technical support / Re: Test Bit for greater than or Less than
« on: January 14, 2020, 01:59:32 PM »
Gary I figured it all out. It was driving me crazy until I actually did the math one step at a time.
I had totally missed the fact that if you subtract 1 in the value in N you get all 1's below the value of N
Then when you do an & of FF with L you only get a 1 if the bits match so the less than works
Next it took a while but I realized that when you do the Exclusive or it changes all the bits above either L or N into 1's
Then any bit greater than L produces a 1 when you do a & with Calls & H so the greater than so the greater than works.
Your a genius for figuring this out with such a small amount of code. 

As usual thanks for your expert help

17
Technical support / Re: Test Bit for greater than or Less than
« on: January 14, 2020, 08:49:09 AM »
Gary for me the Ladder Logic is easy I have attached a simplified version how I have always done a circuit similar to what I had asked you for. However I totally impressed with your Basic version which works exceptionally well with such a small amount of code however I cannot totally understand exactly how your Basic program does what it does.
L =N -1
IF CALLS & L SETIO CBP ELSE CLRIO CBP ENDIF 
How does it actually turn out to be If Calls Less than be?
My brain keeps seeing if N = 4 then L would be 3 then any Call Value below 3 would be less that 3 but how does that statement IF CALLS & L equal Less Than
Also the same question for the IF CALLS & H SETIO CAP 

18
Technical support / Re: Test Bit for greater than or Less than
« on: January 10, 2020, 08:19:11 AM »
Gary as usual I guest it would be you that came up with the perfect program to solve my issue.
I forgot to mention that there is always a value in RELAY[1] and only 1 bit will be on at any time.
I had programmed a circuit that worked OK but the code was a lot longer than yours.

Basically the circuit for a bit greater than worked fine so I then reversed the bits in both RELAY[1] and put it into RELAY[3]  & also reversed the bits in RELAY[2] and put them into RELAY[4] then did a compare   

I tested your program today and it works perfectly and requires a lot less code than my program

Thanks

19
Technical support / Test Bit for greater than or Less than
« on: January 09, 2020, 02:14:01 PM »
I have RELAY[1] that uses the first 8 bits 0 to 7 and only one bit is on at any time

I have another RELAY[2] that can have one or more bits 0 to 7 on
I need to turn on a bit that only turns on if any of the bits in RELAY[2] is greater than the bit in RELAY[1]
Then I also need a different bit to turn on if any bit that is of lower value than the bit in RELAY[1] regardless if any bit that is higher than RELAY[1] is also on.

20
Technical support / NETCMD$
« on: March 01, 2019, 12:15:12 PM »
I need someone to clarify something for me.
If in my program I am using the NETCMD$(2, _____)to send or receive information in and out of port 2
It's my understanding from reading the manual that the Ethernet can use the vertual COMM port #4
Do I just change the statement to NETCMD$(2,____) to NETCMD$(4,____ for all the NETCMD's

21
Technical support / Suspending a program
« on: June 27, 2018, 12:45:07 PM »
I am working on a program that is monitoring various inputs and outputs
Inside each of the functions I check to see if there is an error and if so I call a function
that shows the message on the LCD screen which function failed.
What is the best way to prevent the program from exiting that function until the PLC is restarted?
I originally used a long DELAY to hold it but eventually it does exit.

22
Technical support / 16 or 32 bit DM confusion
« on: June 22, 2018, 10:46:31 AM »
I had some spare time and decided to read the manual again and I found an issue that seems to be confusing.
The manual shows 2 examples Decimal IF DM[1] <> -1234 CALL 5 : ENDIF and in hex IF DM[1] <> &HFFFFFB2E CALL 5 : ENDIF
Now its my understanding that the value -1234 or FFFFFB2E are 32 bit values
So why does it allow you to use DM[1] which is 16 bit instead of using DM32[1] which is 32 bit?

23
Technical support / Re:Stepper motor homing sequence not behaving
« on: May 09, 2018, 12:36:41 PM »
I have attached a simplified version of what you will need to fully test your project
There is no wait statements or interlocking between the open and close as I didn't feel it was necessary at this point in time. However you can add a timer into each direction circuit to insure that the doors cannot be reversed to quickly. After the close cycle is done relay R10 will turn on which can then be used to start a timer used to prevent the Open Signal calling the Open Function and you will see that once the open is completed relay R11 will turn on that can be used to start a timer needed to interlock the close.  
I have allowed for a limit switch at both the Closed position as well as the open position
However you really only require the one for the closed position
You will need to look at the INIT custom function and change the speed in pulses per second as well as the accell rate see notes inside the function
Next you will need to set the required number of step pulses required to go from fully closed to fully open
For testing I set the position to 1,000 1/2 steps for the full open position
You can test this program on the built in simulator and view the results on the build in display
I hope this helps

24
Technical support / Doing a search in the program
« on: May 04, 2018, 12:52:51 PM »
Does anyone know if there is an easy way to find a actual relay or output without finding every single word or relay that has some of the same letters in it?
Example lets say I have a relay # 147 and it has been defined as (Fault) but I also have relays defined as Fault_1 through Fault_50.
When you do a search for "Fault" the program will stop ant every single thing with the Fault in it including any text in any comments.

25
Technical support / Re:Stepper motor homing sequence not behaving
« on: May 04, 2018, 12:45:27 PM »
After reading this post I decide to add my comments as I am very familiar with the type of doors he is talking about.
They are vertical sliding doors that can either be a single door or two doors that meet in the middle and one goes up while the other goes down.
From experience I would not recommend using a stepper motor for that type of door control
Stepper motors by them selves do not have any feed back and therefore the actual position is really never known if the motor fails to step for any reason.
You can however use a lit switch at each end of travel one when the door is fully closed (Home Position) and one when the door is fully open then you can call a stop motor command on the rising edge of each limit.    
If the doors are properly counter weighted then a power failure at any position should not be a problem and yes it is wise to only cause a close or homing command when a button is pressed.
Your only problem is to insure that when you give a close command that the stepper motor will keep stepping in the down direction until it sees the lower limit switch open and when you give an open command the stepper motor will stop at the right count but will also reset if the upper limit is open.

26
Technical support / Re:Two PLC'S on one router
« on: April 23, 2018, 01:14:05 PM »
Thanks for the information I asked for my
My DLink 7850 does not have a place to change the unknown to a name.

However when I was doing my initial testing I did use a static IP address
I then switch to a DHCP as we will have no control over the router that the PLC's get connected to.
The PLC's will be shipped all over the world and could be any make or model.
However whenever the PLC boots up I am showing the assigned IP address on the LCD screen
Plus we supply a hand held text display that the tech can use to find the signed IP address.  

27
Technical support / Re:Two PLC'S on one router
« on: April 20, 2018, 10:54:00 AM »
OK I have tested this scenario many times and found the problem is in the Router
I spoke to someone that is well versed in the subject and he stated that it is an issue with the routers and that yes they have been know to issue the same IP to two different devices if they request an IP at the exact same time.
The only solution was to put a delay of 1 1/2 seconds in the startup of one of the PLC's
This now solves the issue as now both PLC's are no longer requesting an IP address at the same time.

I now have a new question
When you monitor a router it will always show the MAC Address, the IP Address as well as a name
However when I connect 1 or more PLC'S the name always shows as (unknown)
I downloaded a node name into each PLC but that did not change anything.
Can anyone tell me if there is a way to show a name of a PLC in the router?

28
Technical support / Two PLC'S on one router
« on: April 05, 2018, 11:52:05 AM »
I am having an issue when connecting two PLC's to the same router
I am guessing that I need to change one of the settings in the router.
In my setup one PLC has an ID of 01 the other PLC has an ID of 02
If I power each PLC up separately there is no issue they each get a different IP address
such as 1 gets 192.168.0.130 the other one gets 192.168.0.161
However if both PLC's power up at the same time then the both show the same IP address of example 192.168.0.130
The router shows two devices with the same IP but different mac address

29
Technical support / Re:Simulation of Clock
« on: March 06, 2018, 11:21:24 AM »
Gary

Your circuit works perfectly however you had a small typo error
TIME[3] = C ' should have been set the seconds

Also I added Date[3] = D 'Set the day of the week
and added SETLCD 2,1 "DAY = " + STR$ (D,2)

Now I was able to test my multiple times and days perfectly

Again thanks for your help

Lorne

30
Technical support / Re:Simulation of Clock
« on: March 06, 2018, 08:55:09 AM »
Gary
Again thanks for the quick replay and great explanation.
As usual you are amassing at coming up with solutions.
I will test your suggestion
As for the Status 18 it is used to return the current real time clock value

Pages: 1 [2] 3 4 ... 7