PDA

View Full Version : Re: Contest Entry for an Wireless Web based Ship Monitoring and Control system



bsnut
03-17-2011, 01:53 AM
This is contest entry for an Wireless Web based Ship Monitoring and Control system that will be able to check on status and control ship based monitoring systems such as
1) Monitor and control the Bilge Alarm panel in case of flooding problems. Which as 13 inputs.
2) Monitor and control the F/A panel in case of fire on board ship.
3) Monitor the Electrical Switchboard.
4) Monitor and control the Solar Charger.

The system will be able to allow key personnel to see status by web browser and also be able to silence the horn that will be mounted outside on the ship's deck through the web browser. The system will send and receive status from the Propeller based I/O controller using Bi-Directional Serial communicate to the Spinneret. The Spinneret will be connected to CradlePoint CBA250 allow access to the Spinneret to communicate to the outside world.


This will be aboard the former USS Zuni / USCGC Tamaroa which was the ship the book and the movie "The Perfect Storm" was based on.

bsnut
03-18-2011, 04:47 PM
Hi all,

As you all can tell. Me and an other member of Zuni Maritime Foundation are working on our web based monitoring our ship and what I am looking for the best or the easier object to work with. This object has to be able to read the RS485 com port which will be setup to talk to and from an Propeller, which is reading and controlling the I/O (eg alarm horn, push buttons and float switches).

The one big question that I have is. Will this variable name like this


alrm
and a value like this


12
work for http coding that will need be sent and received from the Propeller or those it need to be like this


alrm1 = 0 'float switch off
alrm1 = 1 'float switch on

The goal of this question is to make sure sending the correct variables back to the Spinneret.

Attached is a photo of the ship that system will be going on and a drawing on how the system is going be setup to give you all an idea what trying to do.

Thanks for any help you all provide and you all will be helping our ship.

Updated: I have changed the block diagram based on forum members suggestions

Mike G
03-18-2011, 06:14 PM
Um... I'm not sure what you're asking.

Two common methods for submiting variables to a web server are in the URL (GET) and in the body of the HTTP message (POST).
http://www.w3.org/Protocols/rfc2616/rfc2616.html

A GET request looks like [some url]?name=value&name2=value2
A POST is when you submit a web form. The form name/value collection is contained in the body of the HTTP message and looks like [header] [new line] [new line] [name=value&name2=value2] if you where to view the request.

bsnut
03-19-2011, 04:19 AM
What, I am asking is what are there legal values for GET and POST requests? Can the GET request have an numbers like this 3 or 5 in the value or value2 in your example
[some url]?name=value&name2=value2.

Why, I ask this is each input the Propeller sends down the RS485 network has an number value assign to it, like this

alrmval = 1 (bilge switch 1) and alrmval = 2 (bilge switch 2) and so on for following inputs.

The main goal is to see the states of the inputs that are connected to the Propeller and also send back an value such as this silval = 1 which can silence that input, which in turn silences the outside horn.

I am sorry for the misunderstanding I work overnite maintenance and was up for 16+ hours and hope you understand what I am trying to do.

Mike G
03-19-2011, 05:28 AM
What, I am asking is what are ther legal values for GET and POST requests? Can the GET request have an numbers like this 3 or 5 in the value or value2 in your example
[some url]?name=value&name2=value2.


Sure, no problem... just be careful of encoding.



Why, I ask this is each input the Propeller sends down the RS485 network has an number value assign to it, like this

alrmval = 1 (bilge switch 1) and alrmval = 2 (bilge switch 2) and so on for following inputs.


The communication protocol is up to you. Is alrmval = 1 a Naval standard?

bsnut
03-19-2011, 08:17 AM
Is alrmval = 1 a Naval standard?
No, is not. It is something that I came up with. This is my first time working with HTTP coding and working with the Spinneret. The member with our group is also helping me, it is his first time working with the Spinneret as well. I just wanted to double check.

Since I know this now. I can finalized the Propeller Based I/O Controller that will be down near the main switchboard.

Cool and thank you for your help.

xanadu
03-20-2011, 12:05 AM
If the GSM modem is RS232, does that mean you're doing serial over Ethernet through the WIZNet chip?

bsnut
03-20-2011, 04:45 AM
@xanadu,


If the GSM modem is RS232, does that mean you're doing serial over Ethernet through the WIZNet chip?
Yes, I was talked out of using Ethernet to talk to my Propeller I/O Controller, because I need the I/O pins on the Prop and I was trying to do something can't be done. Which is, use the USB programming port for an com port through an USB to Ethernet Adapter and the other end was going to be connected into the Spinneret. I tough it could be done. I love using RS485 because it is easy to add anything into the network and the cable runs can run up to 4000 foot.

We are also talking about GSM cellar here in this thread as well.
http://forums.parallax.com/showthread.php?130440-GMS-Cellar-Modem-with-the-Spinneret&p=985769#post985769

The decsion hasn't not been made on which GSM modem I was going to use.

Me and an other member of our group who lives 150 miles away from me are working together on this project. He will be are beta tester and is also doing http coding for the site design and I am doing the hardware design and coding for the Propeller I/O Controller and the Spinneret.

xanadu
03-22-2011, 12:52 AM
Whoops, just realized I wrote the same thing yesterday haha.

I could be way off base here, but just an FYI - remember this is a Spinneret contest, not a Propeller chip contest. I'm not sure if I fully understand what you said above but it sounds to me like your shying away from the 5100 chip, which leaves only a Prop chip, not really a Spinneret. I would consider talking to Parallax about that before building it.

The 4 pins on the Spinneret are plenty to talk to another Prop chip, and then that one can talk to even more, aren't they? Then you take your GSM modem's TCP/IP stack and setup your WAN network. You should highly consider a gateway between the modem and the Spinneret.

bsnut
03-22-2011, 02:48 AM
That's ok. I do realized this an Spinneret contest, not a Propeller chip contest. I am going to use the 5100 chip and I am not going to shy away form it.

Ok, which GSM modem do you suggest me to use for this contest? This was the one, I was thinking about to use first PIC GSM Cellular Development Board http://www.sparkfun.com/products/8851

We are nonprofit group and any thing we do comes out of our pockets or from dontions from other people like you.

xanadu
03-22-2011, 08:18 PM
Hey sorry for beating that issue to death lol. I was just confused as to how it worked.


Ok, which GSM modem do you suggest me to use for this contest? This was the one, I was thinking about to use first PIC GSM Cellular Development Board http://www.sparkfun.com/products/8851

My next question is are you sure you want to be locked into GSM 900/1800/1900Mhz?

Where did you want data connectivity in the world?

Is your project more like a monitoring/control system for when the ship is docked and empty?

Controlling bilges and silencing alarms on a ship that size, why not just stick to monitoring? You're really setting the bar high, I don't think it needs to be that high, at least not in this amount of time.

bsnut
03-23-2011, 01:13 AM
That's ok, you are not beating this issue to death and the whole idea is to talk about. Of, course I am trying to stay within one of the guidelines in the contest.


My next question is are you sure you want to be locked into GSM 900/1800/1900Mhz?
It is one board that noticed that had ethernet on the board. Do have any other ideas for better GSM modem?

Where did you want data connectivity in the world?
We as an group needs to be able to see what is going on board ship and this saves us from connected to a landline on shore.

Is your project more like a monitoring/control system for when the ship is docked and empty?
Yes, it is boats and ships do sink?

Controlling bilges and silencing alarms on a ship that size, why not just stick to monitoring?
We need to be able to turn off the outside horn, when we noticed alrarm. This ship is like an small floating building.

I always love an good contest like this one and group can use the prize money if we win. If, I don't win the group is noticed for what we are trying to do and that is saving our nations history.

xanadu
03-23-2011, 03:06 AM
I still don't know where the modem will be operated... You need to include that. Tri-band GSM will only work at port (not out at sea) and only in 75% the ports abroad. Is that cool?

A ship your size is required to have ship to shore, most of those can do data, you sure you can't just use that connection?

xanadu
03-23-2011, 03:09 AM
I always love an good contest like this one and group can use the prize money if we win. If, I don't win the group is noticed for what we are trying to do and that is saving our nations history.

I completely understand, I wish I could work on that ship. That would be a dream come true for me.

bsnut
03-23-2011, 09:11 AM
I still don't know where the modem will be operated... You need to include that. Tri-band GSM will only work at port (not out at sea) and only in 75% the ports abroad. Is that cool?

The GSM modem will be located on the Bridge "02 Deck".

A ship your size is required to have ship to shore, most of those can do data, you sure you can't just use that connection?

Yes, are ship is required to have an basic ship to shore VHF radio for voice communications, which we do have. One thing about VHF ship radios, they only work well in line of sight. They do make marine cellular based systems that do internet, but they are expensive ( I will be happy camper if someone donated one our group.) and I was looking for an inexpensive way to cover all sensors, I want to cover. The other systems that I looked at, only cover 4 points and would send one text message for each point. This type of system is only good for smaller boats.

My idea for an ship monitoring system came from two type of systems. One was text message based and other one was based on an building automation system that is web based for monitoring and control that I work with at my work.

Mike G
03-23-2011, 01:47 PM
bsnut, I have a few question about your project. I think it's a cool project but I don't understand how the components fit together.

How will you connect the Spinneret to the Internet or LAN? Is the GSM modem always connected to the Internet? Can you view the status of the ship with a browser on demand 24/7? If an alarm fires, what happens?

bsnut
03-23-2011, 11:34 PM
bsnut, I have a few question about your project. I think it's a cool project but I don't understand how the components fit together.

How will you connect the Spinneret to the Internet or LAN?
I was going use an GSM modem to be connection to the Internet. I did little bit more looking into the PIC GSM modem and found out it has it's own IP address. So, my thinking is, I my need a Workgroup Switch for the Internet. Yes, can say the GSM modem will make this a interesting project, as you can tell.

Is the GSM modem always connected to the Internet?
Yes, it needs to be connected to the Internet

Can you view the status of the ship with a browser on demand 24/7?
Yes, that is the whole idea of this project.

If an alarm fires, what happens?
When the Fire Alarm goes off it will set off it's horn/strobe that is on the outside of the ship and sent SMS to me, to the directors and an call out list of numbers

Mike G
03-24-2011, 01:04 AM
I just assumed that since the GSM modem takes a SIM card, that the modem would show up on your monthly bill. If I had my cell on and connected to the internet 24/7 that would make for a hefty bill.

xanadu
03-24-2011, 02:00 AM
I meant where in the world is the ship when you need internet? I'm probably over complicating this. You probably just need this to work at port in VA right?

xanadu
03-24-2011, 02:01 AM
I just assumed that since the GSM modem takes a SIM card, that the modem would show up on your monthly bill. If I had my cell on and connected to the internet 24/7 that would make for a hefty bill.

I think that depends on the carrier and most require an unlimited data plan now because of those abnormally high bills.

xanadu
03-24-2011, 02:05 AM
They do make marine cellular based systems that do internet, but they are expensive ( I will be happy camper if someone donated one our group.)

No, this is where the confusion is coming from. There is not cellular on the ocean, there is only satellite. Cellular uses ground based antennas which in SoCal we have voice 1 mile offshore, data to about 1.5 miles, past that nothing. If you need this to work in international shipping lanes, it's not gonna happen on GSM.

bsnut
03-24-2011, 02:12 AM
Yes it does use an SIM card. The one good thing that this GSM modem has, it uses the an PIC chip to pass the data through to the cellular module. I also know, I need to reprogram the PIC that is on this board as well. You also gave me the idea of using the RS232 part for sending SMS messages to our key personnel. But, I the idea is I want to catch false alarms before an SMS messages is sent out. I will also make to the change my block diagram later on.

Are big goal is to save are nations history. Remember this ship did the real rescue in the "Prefect Storm" that the book and movie was based on.

bsnut
03-24-2011, 07:28 AM
Let me cover everyone's points.

The monitoring system will be use when we are docked and not when the ship is out at sea. Remember this is going to be an museum ship. It's only going to be used when no one is on board doing work or giving tours.

Let me move on to your guys other point about the Sim card. Right now we will be doing prepaid for testing and I realize it can be expensive for the long term. One of my goals is to get unlimited data plan with an cell phone provider. If, I can't get an unlimited data plan I will need to come up with something else.

I guess, I didn't give all the details about this project and that is my problem for not providing all of information to the forum members.

bsnut
03-24-2011, 02:25 PM
Let me clear up any misunderstandings in my posts. I know that cell phones don't work beyond 1.5 miles from shore and satellite will only work. Some of my posts are done at work on my phone, due to the fact I work overnight electrical maintenance and have to stop in the middle of an post. I am thinking that you all have visited our group's website to see what we are all about, since it is posted in another thread in the Spinneret forums. Here is our website to give you all idea what are group is trying to do with our ship http://www.zunitamaroa.org/

Are group works off of donations and our group members to keep our projects going. This project is coming out of my and another member's pocket to fund what we are going to do.

Remember I am open to all suggestions that you all make and I may use them in this project in one way.

xanadu
03-24-2011, 09:40 PM
Let me clear up any misunderstandings in my posts. I know that cell phones don't work beyond 1.5 miles from shore and satellite will only work. Some of my posts are done at work on my phone, due to the fact I work overnight electrical maintenance and have to stop in the middle of an post. I am thinking that you all have visited our group's website to see what we are all about, since it is posted in another thread in the Spinneret forums. Here is our website to give you all idea what are group is trying to do with our ship http://www.zunitamaroa.org/

Are group works off of donations and our group members to keep our projects going. This project is coming out of my and another member's pocket to fund what we are going to do.

Remember I am open to all suggestions that you all make and I may use them in this project in one way.

Okay thank you. I was never quite sure where it would need to work that's why all the questions. So now you just need to see which carrier has the best signal on the boat and what it costs.

Also keep in mind the inexpensive 3G connections use dynamic IPs. You will need a service like dyndns.com running to reach it from the outside world. That will need a compatible router or computer on the network to update. They will also disable some incoming ports, and outgoing ports.

I would look at CradlePoint too, they make excellent products and it's the same price as the sparkfun board.

One other thought- Since you're working on such a historic ship, you may be able to get a wireless sponsor. I bet if you found the right person at the right provider you could work a deal. Given the nature of the ship being a museum, if I were Verizon or Sprint I'd gladly do something like that.

bsnut
03-24-2011, 11:21 PM
Okay thank you. I was never quite sure where it would need to work that's why all the questions. So now you just need to see which carrier has the best signal on the boat and what it costs.

Also keep in mind the inexpensive 3G connections use dynamic IPs. You will need a service like dyndns.com running to reach it from the outside world. That will need a compatible router or computer on the network to update. They will also disable some incoming ports, and outgoing ports.

I would look at CradlePoint too, they make excellent products and it's the same price as the sparkfun board.

One other thought- Since you're working on such a historic ship, you may be able to get a wireless sponsor. I bet if you found the right person at the right provider you could work a deal. Given the nature of the ship being a museum, if I were Verizon or Sprint I'd gladly do something like that.

Thank you for your post Xanadu . Is this the site and idem you are talking about http://cradlepoint.com/products/wireless-n-portable-router-ctr35? This is an cool product and I knew that one was out there and it is priced right. I have an Virgin Mobile USB modem that I was using for the laptop (one I am doing this post on), which I don't use anymore due to the fact that I have smart phone which I use now for my laptop Internet connection now.

I was trying to use the Virgin Mobile USB modem in this project, but didn't think it would work. The Virgin Mobile USB modem, now has unlimited Internet access for around $40 a month and it's prepaid This now changes the whole show now and meets the requirement of this contest and provides the ship with Internet access, which was my other goal.

xanadu
03-25-2011, 12:32 AM
Thank you for your post Xanadu . Is this the site and idem you are talking about http://cradlepoint.com/products/wireless-n-portable-router-ctr35? This is an cool product and I knew that one was out there and it is priced right. I have an Virgin Mobile USB modem that I was using for the laptop (one I am doing this post on), which I don't use anymore due to the fact that I have smart phone which I use now for my laptop Internet connection now.

I was trying to use the Virgin Mobile USB modem in this project, but didn't think it would work. The Virgin Mobile USB modem, now has unlimited Internet access for around $40 a month and it's prepaid This now changes the whole show now and meets the requirement of this contest and provides the ship with Internet access, which was my other goal.


The CTR35 can be problematic and doesn't connect the WAN to wired network in the way you need, only wi-fi. I could be wrong since I haven't had one in awhile and sometimes they do add stuff in firmware releases. The other thing is the CTR35 has NO external antenna port for the built in wireless, so that's not good if you want there to be any wireless on the ship, you're going to need a real antenna on it, and probably another access point in addition to it on your LAN.

Check this PDF if you haven't-
http://cradlepoint.com/files/uploads/Cradlepoint_ProductLine_02-11_sm.pdf

Because of port forwarding, routing, and the fact your IP is dynamic. I would go with the CTR500. It has a whole slew of features you can use IF you have a supported USB or PCMCIA Modem device :)

You should call up CradlePoint, explain who,what,where,why. I think that any vendor would be more than obliged to help you out. I don't want to give you any bad advice so it's hard to be specific when you're over there. Honestly if I were CradlePoint and your mobile provider I'd be giving you some deep discounts, being a Historic Maritime Museum, I wouldn't expect anything less. In fact I insist (if you have not) you look for sponsors for this type of thing, you could be missing out on some really good deals.

bsnut
03-25-2011, 05:46 AM
Thanks for pointing out the CTR500 Xanadu. I was also looking at the CBA250, which we maybe getting. It provides IP Pass-Through capabilities for a LAN device requiring wireless broadband access and it's at the same price as the CTR500 which cool as well. Do have any experience with the CBA250 or toughs?

xanadu
03-26-2011, 08:24 PM
Thanks for pointing out the CTR500 Xanadu. I was also looking at the CBA250, which we maybe getting. It provides IP Pass-Through capabilities for a LAN device requiring wireless broadband access and it's at the same price as the CTR500 which cool as well. Do have any experience with the CBA250 or toughs?

I haven't used that one, but it looks like a good choice. If you plug the CBA250 into a router that does port forwarding and dynamic DNS you should be ok without a computer on the LAN. For your available incoming port range you're at the mercy of your carrier. Some block the usual ports, some block the upper range, some change when they feel like it...

So yeah that hardware is going to get you by. As IT goes, I'm not really allowed to recommend running a web server on a non-business ISP account with a dynamic IP. If you're going to do this, you should consider getting a static IP business account. That would be much more reliable and less restricted as far as ports, and their terms of service. There's always a chance you can upgrade the account on the fly so my best advice is test what you can without buying anything, make some calls, etc.

bsnut
03-27-2011, 08:54 AM
I would like to update our project status on what we decided to do. Some of you have seen the old block diagram and noticed the we were going to use RS485 to communicate with the Spinneret. We also decided to use this for future expansion at a later date and the following is how the system is going to be setup.

The Spinneret Ethernet connection is going to communicate with the CradlePoint CBA250 which is going to have the Virgin Mobile USB modem plugged into the CBA250. Of, course the CBA250 will be located on the Bridge "02 Deck", which is the highest point on our ship.

The Spinneret will be next to and connected to the Gadget Gangster Propeller Platform USB. It will communicate using the the "Full Duplex Serial" to pass the control variables back and forth to the Spinneret.

I will update the Block Diagram today and will post our updates in this thread as we move through the coding and testing phases of this project. I will also post our code as well.

xanadu
03-28-2011, 10:44 PM
Awesome, let me know when I can log in and drive the ship around please :)

bsnut
03-29-2011, 05:37 PM
Taking ship out for spin would required an big donation from you of course.
Yes, I will post the site for everyone to see and operate the system when are ready.

There will be an demo program for the testing phase of course, before it is finally turned on. This program will work just like if an real Bilge switch was triggered or if the F/A was in alarm or in trouble. This needs to be done to test the site with the I/O board.

Remember this is just one of projects we have on our plate. So visit our website to see what is going on.

bsnut
03-31-2011, 02:08 PM
I would like to pass this update on to everyone.

One of my big bits of code is done for the Propeller I/O Controller. This code was compiled using an program call PICoPLC, which is a ladder logic editor that converts the ladder logic into spin. I will post the code that the PICoPLC compiled later on. PICoPLC allow me to do the I/O Controller in ladder logic and it also allow me to test it before it is programmed on the Propeller.

This now leaves me to do the code for the Top Object file, which communicates between the Spinneret and Propeller Platform USB Board and brings everything together in one application. Also I started on the RS-485 code, which allows the future expansion to other boards on a RS-485 network.

I also started on the PCB this past weekend that needs to be made, which the Propeller Platform USB sets on top of. This has the I/O circuits on it so that outside world can come into the Propeller's world. This board has four IC types on it and they are
1) Voltage Regulator for the I/O to the board
2) ULN2003 to drive the relays.
3) Optoisolators for the inputs.

One question still reminds and that is. Since I am going to use Full Duplex Serial to communicate with the Spinneret on two I/O pins, I am wondering if I can share these two pins with the RS-485 chip (LTC 1485 or ADM1485), which this will save me an I/O pin?

Remember, I used one of your suggestions already and I am still open for any others you my have.

Mike G
03-31-2011, 02:53 PM
One question still reminds and that is. Since I am going to use Full Duplex Serial to communicate with the Spinneret on two I/O pins, I am wondering if I can share these two pins with the RS-485 chip (LTC 1485 or ADM1485), which this will save me an I/O pin?


I think you can share the DI/RO pins with the serial driver's Rx/Tx pins. I'd have to test the interface to be sure. But I don't think it is a good idea. You'll have to deal with collisions or timing and modify the FullDuplex driver.

Why not use J2's Rx/Tx and J1 for the RS485?

bsnut
03-31-2011, 05:21 PM
Thanks Mike, I had the feeling sharing the DI/RO pins with the serial driver's Rx/Tx pins maybe an problem. I may end up doing what I was planning before I posted that question.

Mike G
03-31-2011, 05:31 PM
You do realize that there is a dedicated serial Rx/Tx port on the Spinneret, right?

bsnut
03-31-2011, 11:06 PM
Yes, I do realize that Mike. I may end up needing to take that route and will let everyone know what I plan to do in my next post.

bsnut
04-03-2011, 01:56 AM
I like would to pass this update to everyone regardening how I plan to communicate with the Spinneret.

As you may know, I was going to use the Full Duplex Serial object to do this task, but the after Mike G. pointed out, that the Spinneret 3 pin header for serial I had to do some thinking. I also wanted gain the extra I/O, so I can use the last pin on the ULN2003A and do RS-485 which needs two pins minimum (one for serial and the other for direction control). So, what I am going to do is, use one pin for Bi-direction serial to communicate with the Spinneret and Bi-direction serial on another pin to communicate with the RS-485 chip and this leaves the one pin to control the direction of the RS-485 chip.

I will agian update my first post that I made regardening the change in plans.

bsnut
04-10-2011, 07:49 AM
I would like to show everyone the finished code for the ladder logic part of are monitoring system, which was compiled from the PICoPLC ladder logic editor program.

If you want to view the ladder logic itself you will need to download the PICoPLC program. Just do a search for PICoPLC in the search box and you should find the link for the software. I will send the ladder file, which this was compiled from to anyone who wants to see it by email, just PM me your request.

{ This is auto-generated code from PICoPLC. Do not edit this file! Go
back to the ladder diagram source for changes in the logic, and compile }

CON
_CLKFREQ = 4000000 'Hz
_CLKMODE = XTAL1 + PLL16X
CycleTime = 100 '1/sec
var
BYTE I_mcr
var
BYTE I_rung_top
var
BYTE U_Rpulsebit
var
WORD U_Tfreerun
var
BYTE I_parOut_0000
var
BYTE I_parThis_0000
var
BYTE I_oneShot_0000
var
WORD U_Cshift
con
U_Xbilge1 = 5
con
U_Xacbilgeloss = 4
var
WORD U_Tdelay1
var
BYTE U_Ralrmsil1
var
BYTE I_parOut_0001
var
BYTE I_parThis_0001
var
WORD I_scratch2
var
BYTE I_parOut_0002
var
BYTE I_parThis_0002
var
WORD U_alrmvar
var
BYTE U_Rtextsil1
var
WORD U_smsvar
var
BYTE U_Ralrm1
var
BYTE I_parOut_0003
var
BYTE I_parThis_0003
var
BYTE I_parOut_0004
var
BYTE I_parThis_0004
con
U_Xsilencepb = 19
var
WORD U_silvar
var
BYTE U_Rsysreset
var
BYTE I_parOut_0005
var
BYTE I_parThis_0005
var
BYTE U_Rtextsil
con
U_Xbilge2 = 6
var
WORD U_Tdelay2
var
BYTE U_Ralrmsil2
var
BYTE I_parOut_0006
var
BYTE I_parThis_0006
var
BYTE I_parOut_0007
var
BYTE I_parThis_0007
var
BYTE U_Rtextsil2
var
BYTE U_Ralrm2
var
BYTE I_parOut_0008
var
BYTE I_parThis_0008
var
BYTE I_parOut_0009
var
BYTE I_parThis_0009
var
BYTE I_parOut_000a
var
BYTE I_parThis_000a
con
U_Xbilge3 = 7
var
WORD U_Tdelay3
var
BYTE U_Ralrmsil3
var
BYTE I_parOut_000b
var
BYTE I_parThis_000b
var
BYTE I_parOut_000c
var
BYTE I_parThis_000c
var
BYTE U_Rtextsil3
var
BYTE U_Ralrm3
var
BYTE I_parOut_000d
var
BYTE I_parThis_000d
var
BYTE I_parOut_000e
var
BYTE I_parThis_000e
var
BYTE I_parOut_000f
var
BYTE I_parThis_000f
con
U_Xbilge4 = 8
var
WORD U_Tdelay4
var
BYTE U_Ralrmsil4
var
BYTE I_parOut_0010
var
BYTE I_parThis_0010
var
BYTE I_parOut_0011
var
BYTE I_parThis_0011
var
BYTE U_Rtextsil4
var
BYTE U_Ralrm4
var
BYTE I_parOut_0012
var
BYTE I_parThis_0012
var
BYTE I_parOut_0013
var
BYTE I_parThis_0013
var
BYTE I_parOut_0014
var
BYTE I_parThis_0014
con
U_Xbilge5 = 9
var
WORD U_Tdelay5
var
BYTE U_Ralrmsil5
var
BYTE I_parOut_0015
var
BYTE I_parThis_0015
var
BYTE I_parOut_0016
var
BYTE I_parThis_0016
var
BYTE U_Rtextsil5
var
BYTE U_Ralrm5
var
BYTE I_parOut_0017
var
BYTE I_parThis_0017
var
BYTE I_parOut_0018
var
BYTE I_parThis_0018
var
BYTE I_parOut_0019
var
BYTE I_parThis_0019
con
U_Xbilge6 = 10
var
WORD U_Tdelay6
var
BYTE U_Ralrmsil6
var
BYTE I_parOut_001a
var
BYTE I_parThis_001a
var
BYTE I_parOut_001b
var
BYTE I_parThis_001b
var
BYTE U_Rtextsil6
var
BYTE U_Ralrm6
var
BYTE I_parOut_001c
var
BYTE I_parThis_001c
var
BYTE I_parOut_001d
var
BYTE I_parThis_001d
var
BYTE I_parOut_001e
var
BYTE I_parThis_001e
con
U_Xbilge7 = 11
var
WORD U_Tdelay7
var
BYTE U_Ralrmsil7
var
BYTE I_parOut_001f
var
BYTE I_parThis_001f
var
BYTE I_parOut_0020
var
BYTE I_parThis_0020
var
BYTE U_Rtextsil7
var
BYTE U_Ralrm7
var
BYTE I_parOut_0021
var
BYTE I_parThis_0021
var
BYTE I_parOut_0022
var
BYTE I_parThis_0022
var
BYTE I_parOut_0023
var
BYTE I_parThis_0023
con
U_Xbilge8 = 12
var
WORD U_Tdelay8
var
BYTE U_Ralrmsil8
var
BYTE I_parOut_0024
var
BYTE I_parThis_0024
var
BYTE I_parOut_0025
var
BYTE I_parThis_0025
var
BYTE U_Rtextsil8
var
BYTE U_Ralrm8
var
BYTE I_parOut_0026
var
BYTE I_parThis_0026
var
BYTE I_parOut_0027
var
BYTE I_parThis_0027
var
BYTE I_parOut_0028
var
BYTE I_parThis_0028
con
U_Xbilge9 = 13
var
WORD U_Tdelay9
var
BYTE U_Ralrmsil9
var
BYTE I_parOut_0029
var
BYTE I_parThis_0029
var
BYTE I_parOut_002a
var
BYTE I_parThis_002a
var
BYTE U_Rtextsil9
var
BYTE U_Ralrm9
var
BYTE I_parOut_002b
var
BYTE I_parThis_002b
var
BYTE I_parOut_002c
var
BYTE I_parThis_002c
var
BYTE I_parOut_002d
var
BYTE I_parThis_002d
var
WORD U_Tdelay10
var
BYTE U_Ralrmsil10
var
BYTE I_parOut_002e
var
BYTE I_parThis_002e
var
BYTE I_parOut_002f
var
BYTE I_parThis_002f
var
BYTE U_Rtextsil10
var
BYTE U_Ralrm10
var
BYTE I_parOut_0030
var
BYTE I_parThis_0030
var
BYTE I_parOut_0031
var
BYTE I_parThis_0031
var
BYTE I_parOut_0032
var
BYTE I_parThis_0032
var
WORD U_Tdelay11
var
BYTE U_Ralrmsil11
var
BYTE I_parOut_0033
var
BYTE I_parThis_0033
var
BYTE I_parOut_0034
var
BYTE I_parThis_0034
var
BYTE U_Rtextsil11
var
BYTE U_Ralrm11
var
BYTE I_parOut_0035
var
BYTE I_parThis_0035
var
BYTE I_parOut_0036
var
BYTE I_parThis_0036
var
BYTE I_parOut_0037
var
BYTE I_parThis_0037
var
WORD U_Tdelay12
var
BYTE U_Ralrmsil12
var
BYTE I_parOut_0038
var
BYTE I_parThis_0038
var
BYTE I_parOut_0039
var
BYTE I_parThis_0039
var
BYTE U_Rtextsil12
var
BYTE U_Ralrm12
var
BYTE I_parOut_003a
var
BYTE I_parThis_003a
var
BYTE I_parOut_003b
var
BYTE I_parThis_003b
var
BYTE I_parOut_003c
var
BYTE I_parThis_003c
var
WORD U_Tdelay13
var
BYTE U_Ralrmsil13
var
BYTE I_parOut_003d
var
BYTE I_parThis_003d
var
BYTE I_parOut_003e
var
BYTE I_parThis_003e
var
BYTE U_Rtextsil13
var
BYTE U_Ralrm13
var
BYTE I_parOut_003f
var
BYTE I_parThis_003f
var
BYTE I_parOut_0040
var
BYTE I_parThis_0040
var
BYTE I_parOut_0041
var
BYTE I_parThis_0041
con
U_Xfaalarm = 14
var
WORD U_Tdelay14
var
BYTE U_Rfahornsil
var
BYTE I_parOut_0042
var
BYTE I_parThis_0042
var
BYTE I_parOut_0043
var
BYTE I_parThis_0043
var
BYTE U_Rtextsil14
var
BYTE U_Ralrm14
var
BYTE I_parOut_0044
var
BYTE I_parThis_0044
var
BYTE I_parOut_0045
var
BYTE I_parThis_0045
con
U_Yfahornsil = 22
var
BYTE I_parOut_0046
var
BYTE I_parThis_0046
con
U_Xfatrouble = 15
var
WORD U_Tdelay15
var
BYTE U_Ralrmsil15
var
BYTE I_parOut_0047
var
BYTE I_parThis_0047
var
WORD U_statvar
var
BYTE U_Ralrm15
var
BYTE I_parOut_0048
var
BYTE I_parThis_0048
var
BYTE I_parOut_0049
var
BYTE I_parThis_0049
con
U_Xportpwrbreaker = 17
con
U_Xportprwloss = 16
var
WORD U_Tdelay16
var
BYTE I_scratch
var
BYTE I_oneShot_0001
var
BYTE I_parOut_004a
var
BYTE I_parThis_004a
var
BYTE I_parOut_004b
var
BYTE I_parThis_004b
var
BYTE U_Ralrml2
var
BYTE U_Ralarm
var
BYTE I_parOut_004c
var
BYTE I_parThis_004c
var
BYTE U_Rflash
var
WORD U_Tflashon
var
BYTE I_Tflashoff_antiglitch
var
WORD U_Tflashoff
con
U_Yalrmbuzzer = 21
var
BYTE I_parOut_004d
var
BYTE I_parThis_004d
con
U_Yalarmlt = 20
var
BYTE I_parOut_004e
var
BYTE I_parThis_004e
con
U_Xresetpb = 18
var
WORD U_resetvar
var
BYTE I_parOut_004f
var
BYTE I_parThis_004f
var
BYTE I_parOut_0050
var
BYTE I_parThis_0050


VAR
LONG stack[100]
LONG cog

PUB Start
cog := cognew(PlcCycle, @stack) +1

PUB Stop
if (cog)
cogstop(cog~ - 1)
cog~

PRI PlcCycle | timing
DIRA := $00700000
DIRB := $00000000

timing := cnt + clkfreq / CycleTime
repeat
I_mcr~~

{ start rung 2 }
I_rung_top := I_mcr

{ start series [ }
{ Negated contact }
if (U_Rpulsebit)
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tfreerun < 9)
U_Tfreerun++
I_rung_top~

else
U_Tfreerun := 0


{ start parallel [ }
I_parOut_0000~
I_parThis_0000 := I_rung_top
{ Normal coil }
U_Rpulsebit := I_parThis_0000

if (I_parThis_0000)
I_parOut_0000~~

I_parThis_0000 := I_rung_top
{ CTC element }
if (I_parThis_0000)
ifnot (I_oneShot_0000)
U_Cshift++
if (U_Cshift < 21)
else
U_Cshift := 0



I_oneShot_0000 := I_parThis_0000

if (I_parThis_0000)
I_parOut_0000~~

I_rung_top := I_parOut_0000
{ ] finish parallel }
{ ] finish series }

{ start rung 4 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xbilge1])
I_rung_top~


{ Negated contact }
if (INA[U_Xacbilgeloss])
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tdelay1 < 299)
U_Tdelay1++
I_rung_top~

else
U_Tdelay1 := 0


{ Negated contact }
if (U_Ralrmsil1)
I_rung_top~


{ start parallel [ }
I_parOut_0001~
I_parThis_0001 := I_rung_top
{ start series [ }
I_scratch2 := 1
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_parThis_0001~


{ start parallel [ }
I_parOut_0002~
I_parThis_0002 := I_parThis_0001
{ MOVE element }
if (I_parThis_0002)
U_alrmvar := 1


if (I_parThis_0002)
I_parOut_0002~~

I_parThis_0002 := I_parThis_0001
{ start series [ }
{ Negated contact }
if (U_Rtextsil1)
I_parThis_0002~


{ MOVE element }
if (I_parThis_0002)
U_smsvar := 1


{ ] finish series }
if (I_parThis_0002)
I_parOut_0002~~

I_parThis_0001 := I_parOut_0002
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0001)
I_parOut_0001~~

I_parThis_0001 := I_rung_top
{ Normal coil }
U_Ralrm1 := I_parThis_0001

if (I_parThis_0001)
I_parOut_0001~~

I_rung_top := I_parOut_0001
{ ] finish parallel }
{ ] finish series }

{ start rung 5 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0003~
I_parThis_0003 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm1)
I_parThis_0003~


{ start parallel [ }
I_parOut_0004~
I_parThis_0004 := I_parThis_0003
{ Contact }
ifnot (INA[U_Xsilencepb])
I_parThis_0004~


if (I_parThis_0004)
I_parOut_0004~~

I_parThis_0004 := I_parThis_0003
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_0004~


if (I_parThis_0004)
I_parOut_0004~~

I_parThis_0003 := I_parOut_0004
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0003)
I_parOut_0003~~

I_parThis_0003 := I_rung_top
{ Contact }
ifnot (U_Ralrmsil1)
I_parThis_0003~


if (I_parThis_0003)
I_parOut_0003~~

I_rung_top := I_parOut_0003
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Ralrmsil1 := I_rung_top

{ ] finish series }

{ start rung 6 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0005~
I_parThis_0005 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm1)
I_parThis_0005~


{ Contact }
ifnot (U_Rtextsil)
I_parThis_0005~


{ ] finish series }
if (I_parThis_0005)
I_parOut_0005~~

I_parThis_0005 := I_rung_top
{ Contact }
ifnot (U_Rtextsil1)
I_parThis_0005~


if (I_parThis_0005)
I_parOut_0005~~

I_rung_top := I_parOut_0005
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Rtextsil1 := I_rung_top

{ ] finish series }

{ start rung 8 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xbilge2])
I_rung_top~


{ Negated contact }
if (INA[U_Xacbilgeloss])
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tdelay2 < 299)
U_Tdelay2++
I_rung_top~

else
U_Tdelay2 := 0


{ Negated contact }
if (U_Ralrmsil2)
I_rung_top~


{ start parallel [ }
I_parOut_0006~
I_parThis_0006 := I_rung_top
{ start series [ }
I_scratch2 := 2
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_parThis_0006~


{ start parallel [ }
I_parOut_0007~
I_parThis_0007 := I_parThis_0006
{ MOVE element }
if (I_parThis_0007)
U_alrmvar := 2


if (I_parThis_0007)
I_parOut_0007~~

I_parThis_0007 := I_parThis_0006
{ start series [ }
{ Negated contact }
if (U_Rtextsil2)
I_parThis_0007~


{ MOVE element }
if (I_parThis_0007)
U_smsvar := 2


{ ] finish series }
if (I_parThis_0007)
I_parOut_0007~~

I_parThis_0006 := I_parOut_0007
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0006)
I_parOut_0006~~

I_parThis_0006 := I_rung_top
{ Normal coil }
U_Ralrm2 := I_parThis_0006

if (I_parThis_0006)
I_parOut_0006~~

I_rung_top := I_parOut_0006
{ ] finish parallel }
{ ] finish series }

{ start rung 9 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0008~
I_parThis_0008 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm2)
I_parThis_0008~


{ start parallel [ }
I_parOut_0009~
I_parThis_0009 := I_parThis_0008
{ Contact }
ifnot (INA[U_Xsilencepb])
I_parThis_0009~


if (I_parThis_0009)
I_parOut_0009~~

I_parThis_0009 := I_parThis_0008
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_0009~


if (I_parThis_0009)
I_parOut_0009~~

I_parThis_0008 := I_parOut_0009
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0008)
I_parOut_0008~~

I_parThis_0008 := I_rung_top
{ Contact }
ifnot (U_Ralrmsil2)
I_parThis_0008~


if (I_parThis_0008)
I_parOut_0008~~

I_rung_top := I_parOut_0008
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Ralrmsil2 := I_rung_top

{ ] finish series }

{ start rung 10 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_000a~
I_parThis_000a := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm2)
I_parThis_000a~


{ Contact }
ifnot (U_Rtextsil)
I_parThis_000a~


{ ] finish series }
if (I_parThis_000a)
I_parOut_000a~~

I_parThis_000a := I_rung_top
{ Contact }
ifnot (U_Rtextsil2)
I_parThis_000a~


if (I_parThis_000a)
I_parOut_000a~~

I_rung_top := I_parOut_000a
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Rtextsil2 := I_rung_top

{ ] finish series }

{ start rung 12 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xbilge3])
I_rung_top~


{ Negated contact }
if (INA[U_Xacbilgeloss])
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tdelay3 < 299)
U_Tdelay3++
I_rung_top~

else
U_Tdelay3 := 0


{ Negated contact }
if (U_Ralrmsil3)
I_rung_top~


{ start parallel [ }
I_parOut_000b~
I_parThis_000b := I_rung_top
{ start series [ }
I_scratch2 := 3
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_parThis_000b~


{ start parallel [ }
I_parOut_000c~
I_parThis_000c := I_parThis_000b
{ MOVE element }
if (I_parThis_000c)
U_alrmvar := 3


if (I_parThis_000c)
I_parOut_000c~~

I_parThis_000c := I_parThis_000b
{ start series [ }
{ Negated contact }
if (U_Rtextsil3)
I_parThis_000c~


{ MOVE element }
if (I_parThis_000c)
U_smsvar := 3


{ ] finish series }
if (I_parThis_000c)
I_parOut_000c~~

I_parThis_000b := I_parOut_000c
{ ] finish parallel }
{ ] finish series }
if (I_parThis_000b)
I_parOut_000b~~

I_parThis_000b := I_rung_top
{ Normal coil }
U_Ralrm3 := I_parThis_000b

if (I_parThis_000b)
I_parOut_000b~~

I_rung_top := I_parOut_000b
{ ] finish parallel }
{ ] finish series }

{ start rung 13 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_000d~
I_parThis_000d := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm3)
I_parThis_000d~


{ start parallel [ }
I_parOut_000e~
I_parThis_000e := I_parThis_000d
{ Contact }
ifnot (INA[U_Xsilencepb])
I_parThis_000e~


if (I_parThis_000e)
I_parOut_000e~~

I_parThis_000e := I_parThis_000d
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_000e~


if (I_parThis_000e)
I_parOut_000e~~

I_parThis_000d := I_parOut_000e
{ ] finish parallel }
{ ] finish series }
if (I_parThis_000d)
I_parOut_000d~~

I_parThis_000d := I_rung_top
{ Contact }
ifnot (U_Ralrmsil3)
I_parThis_000d~


if (I_parThis_000d)
I_parOut_000d~~

I_rung_top := I_parOut_000d
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Ralrmsil3 := I_rung_top

{ ] finish series }

{ start rung 14 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_000f~
I_parThis_000f := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm3)
I_parThis_000f~


{ Contact }
ifnot (U_Rtextsil)
I_parThis_000f~


{ ] finish series }
if (I_parThis_000f)
I_parOut_000f~~

I_parThis_000f := I_rung_top
{ Contact }
ifnot (U_Rtextsil3)
I_parThis_000f~


if (I_parThis_000f)
I_parOut_000f~~

I_rung_top := I_parOut_000f
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Rtextsil3 := I_rung_top

{ ] finish series }

{ start rung 16 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xbilge4])
I_rung_top~


{ Negated contact }
if (INA[U_Xacbilgeloss])
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tdelay4 < 299)
U_Tdelay4++
I_rung_top~

else
U_Tdelay4 := 0


{ Negated contact }
if (U_Ralrmsil4)
I_rung_top~


{ start parallel [ }
I_parOut_0010~
I_parThis_0010 := I_rung_top
{ start series [ }
I_scratch2 := 4
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_parThis_0010~


{ start parallel [ }
I_parOut_0011~
I_parThis_0011 := I_parThis_0010
{ MOVE element }
if (I_parThis_0011)
U_alrmvar := 4


if (I_parThis_0011)
I_parOut_0011~~

I_parThis_0011 := I_parThis_0010
{ start series [ }
{ Negated contact }
if (U_Rtextsil4)
I_parThis_0011~


{ MOVE element }
if (I_parThis_0011)
U_smsvar := 4


{ ] finish series }
if (I_parThis_0011)
I_parOut_0011~~

I_parThis_0010 := I_parOut_0011
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0010)
I_parOut_0010~~

I_parThis_0010 := I_rung_top
{ Normal coil }
U_Ralrm4 := I_parThis_0010

if (I_parThis_0010)
I_parOut_0010~~

I_rung_top := I_parOut_0010
{ ] finish parallel }
{ ] finish series }

{ start rung 17 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0012~
I_parThis_0012 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm4)
I_parThis_0012~


{ start parallel [ }
I_parOut_0013~
I_parThis_0013 := I_parThis_0012
{ Contact }
ifnot (INA[U_Xsilencepb])
I_parThis_0013~


if (I_parThis_0013)
I_parOut_0013~~

I_parThis_0013 := I_parThis_0012
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_0013~


if (I_parThis_0013)
I_parOut_0013~~

I_parThis_0012 := I_parOut_0013
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0012)
I_parOut_0012~~

I_parThis_0012 := I_rung_top
{ Contact }
ifnot (U_Ralrmsil4)
I_parThis_0012~


if (I_parThis_0012)
I_parOut_0012~~

I_rung_top := I_parOut_0012
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Ralrmsil4 := I_rung_top

{ ] finish series }

{ start rung 18 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0014~
I_parThis_0014 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm4)
I_parThis_0014~


{ Contact }
ifnot (U_Rtextsil)
I_parThis_0014~


{ ] finish series }
if (I_parThis_0014)
I_parOut_0014~~

I_parThis_0014 := I_rung_top
{ Contact }
ifnot (U_Rtextsil4)
I_parThis_0014~


if (I_parThis_0014)
I_parOut_0014~~

I_rung_top := I_parOut_0014
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Rtextsil4 := I_rung_top

{ ] finish series }

{ start rung 20 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xbilge5])
I_rung_top~


{ Negated contact }
if (INA[U_Xacbilgeloss])
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tdelay5 < 299)
U_Tdelay5++
I_rung_top~

else
U_Tdelay5 := 0


{ Negated contact }
if (U_Ralrmsil5)
I_rung_top~


{ start parallel [ }
I_parOut_0015~
I_parThis_0015 := I_rung_top
{ start series [ }
I_scratch2 := 5
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_parThis_0015~


{ start parallel [ }
I_parOut_0016~
I_parThis_0016 := I_parThis_0015
{ MOVE element }
if (I_parThis_0016)
U_alrmvar := 5


if (I_parThis_0016)
I_parOut_0016~~

I_parThis_0016 := I_parThis_0015
{ start series [ }
{ Negated contact }
if (U_Rtextsil5)
I_parThis_0016~


{ MOVE element }
if (I_parThis_0016)
U_smsvar := 5


{ ] finish series }
if (I_parThis_0016)
I_parOut_0016~~

I_parThis_0015 := I_parOut_0016
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0015)
I_parOut_0015~~

I_parThis_0015 := I_rung_top
{ Normal coil }
U_Ralrm5 := I_parThis_0015

if (I_parThis_0015)
I_parOut_0015~~

I_rung_top := I_parOut_0015
{ ] finish parallel }
{ ] finish series }

{ start rung 21 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0017~
I_parThis_0017 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm5)
I_parThis_0017~


{ start parallel [ }
I_parOut_0018~
I_parThis_0018 := I_parThis_0017
{ Contact }
ifnot (INA[U_Xsilencepb])
I_parThis_0018~


if (I_parThis_0018)
I_parOut_0018~~

I_parThis_0018 := I_parThis_0017
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_0018~


if (I_parThis_0018)
I_parOut_0018~~

I_parThis_0017 := I_parOut_0018
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0017)
I_parOut_0017~~

I_parThis_0017 := I_rung_top
{ Contact }
ifnot (U_Ralrmsil5)
I_parThis_0017~


if (I_parThis_0017)
I_parOut_0017~~

I_rung_top := I_parOut_0017
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Ralrmsil5 := I_rung_top

{ ] finish series }

{ start rung 22 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0019~
I_parThis_0019 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm5)
I_parThis_0019~


{ Contact }
ifnot (U_Rtextsil)
I_parThis_0019~


{ ] finish series }
if (I_parThis_0019)
I_parOut_0019~~

I_parThis_0019 := I_rung_top
{ Contact }
ifnot (U_Rtextsil5)
I_parThis_0019~


if (I_parThis_0019)
I_parOut_0019~~

I_rung_top := I_parOut_0019
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Rtextsil5 := I_rung_top

{ ] finish series }

{ start rung 24 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xbilge6])
I_rung_top~


{ Negated contact }
if (INA[U_Xacbilgeloss])
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tdelay6 < 299)
U_Tdelay6++
I_rung_top~

else
U_Tdelay6 := 0


{ Negated contact }
if (U_Ralrmsil6)
I_rung_top~


{ start parallel [ }
I_parOut_001a~
I_parThis_001a := I_rung_top
{ start series [ }
I_scratch2 := 6
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_parThis_001a~


{ start parallel [ }
I_parOut_001b~
I_parThis_001b := I_parThis_001a
{ MOVE element }
if (I_parThis_001b)
U_alrmvar := 6


if (I_parThis_001b)
I_parOut_001b~~

I_parThis_001b := I_parThis_001a
{ start series [ }
{ Negated contact }
if (U_Rtextsil6)
I_parThis_001b~


{ MOVE element }
if (I_parThis_001b)
U_smsvar := 6


{ ] finish series }
if (I_parThis_001b)
I_parOut_001b~~

I_parThis_001a := I_parOut_001b
{ ] finish parallel }
{ ] finish series }
if (I_parThis_001a)
I_parOut_001a~~

I_parThis_001a := I_rung_top
{ Normal coil }
U_Ralrm6 := I_parThis_001a

if (I_parThis_001a)
I_parOut_001a~~

I_rung_top := I_parOut_001a
{ ] finish parallel }
{ ] finish series }

{ start rung 25 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_001c~
I_parThis_001c := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm6)
I_parThis_001c~


{ start parallel [ }
I_parOut_001d~
I_parThis_001d := I_parThis_001c
{ Contact }
ifnot (INA[U_Xsilencepb])
I_parThis_001d~


if (I_parThis_001d)
I_parOut_001d~~

I_parThis_001d := I_parThis_001c
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_001d~


if (I_parThis_001d)
I_parOut_001d~~

I_parThis_001c := I_parOut_001d
{ ] finish parallel }
{ ] finish series }
if (I_parThis_001c)
I_parOut_001c~~

I_parThis_001c := I_rung_top
{ Contact }
ifnot (U_Ralrmsil6)
I_parThis_001c~


if (I_parThis_001c)
I_parOut_001c~~

I_rung_top := I_parOut_001c
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Ralrmsil6 := I_rung_top

{ ] finish series }

{ start rung 26 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_001e~
I_parThis_001e := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm6)
I_parThis_001e~


{ Contact }
ifnot (U_Rtextsil)
I_parThis_001e~


{ ] finish series }
if (I_parThis_001e)
I_parOut_001e~~

I_parThis_001e := I_rung_top
{ Contact }
ifnot (U_Rtextsil6)
I_parThis_001e~


if (I_parThis_001e)
I_parOut_001e~~

I_rung_top := I_parOut_001e
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Rtextsil6 := I_rung_top

{ ] finish series }

{ start rung 28 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xbilge7])
I_rung_top~


{ Negated contact }
if (INA[U_Xacbilgeloss])
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tdelay7 < 299)
U_Tdelay7++
I_rung_top~

else
U_Tdelay7 := 0


{ Negated contact }
if (U_Ralrmsil7)
I_rung_top~


{ start parallel [ }
I_parOut_001f~
I_parThis_001f := I_rung_top
{ start series [ }
I_scratch2 := 7
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_parThis_001f~


{ start parallel [ }
I_parOut_0020~
I_parThis_0020 := I_parThis_001f
{ MOVE element }
if (I_parThis_0020)
U_alrmvar := 7


if (I_parThis_0020)
I_parOut_0020~~

I_parThis_0020 := I_parThis_001f
{ start series [ }
{ Negated contact }
if (U_Rtextsil7)
I_parThis_0020~


{ MOVE element }
if (I_parThis_0020)
U_smsvar := 7


{ ] finish series }
if (I_parThis_0020)
I_parOut_0020~~

I_parThis_001f := I_parOut_0020
{ ] finish parallel }
{ ] finish series }
if (I_parThis_001f)
I_parOut_001f~~

I_parThis_001f := I_rung_top
{ Normal coil }
U_Ralrm7 := I_parThis_001f

if (I_parThis_001f)
I_parOut_001f~~

I_rung_top := I_parOut_001f
{ ] finish parallel }
{ ] finish series }

{ start rung 29 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0021~
I_parThis_0021 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm7)
I_parThis_0021~


{ start parallel [ }
I_parOut_0022~
I_parThis_0022 := I_parThis_0021
{ Contact }
ifnot (INA[U_Xsilencepb])
I_parThis_0022~


if (I_parThis_0022)
I_parOut_0022~~

I_parThis_0022 := I_parThis_0021
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_0022~


if (I_parThis_0022)
I_parOut_0022~~

I_parThis_0021 := I_parOut_0022
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0021)
I_parOut_0021~~

I_parThis_0021 := I_rung_top
{ Contact }
ifnot (U_Ralrmsil7)
I_parThis_0021~


if (I_parThis_0021)
I_parOut_0021~~

I_rung_top := I_parOut_0021
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Ralrmsil7 := I_rung_top

{ ] finish series }

{ start rung 30 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0023~
I_parThis_0023 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm7)
I_parThis_0023~


{ Contact }
ifnot (U_Rtextsil)
I_parThis_0023~


{ ] finish series }
if (I_parThis_0023)
I_parOut_0023~~

I_parThis_0023 := I_rung_top
{ Contact }
ifnot (U_Rtextsil7)
I_parThis_0023~


if (I_parThis_0023)
I_parOut_0023~~

I_rung_top := I_parOut_0023
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Rtextsil7 := I_rung_top

{ ] finish series }

{ start rung 32 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xbilge8])
I_rung_top~


{ Negated contact }
if (INA[U_Xacbilgeloss])
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tdelay8 < 299)
U_Tdelay8++
I_rung_top~

else
U_Tdelay8 := 0


{ Negated contact }
if (U_Ralrmsil8)
I_rung_top~


{ start parallel [ }
I_parOut_0024~
I_parThis_0024 := I_rung_top
{ start series [ }
I_scratch2 := 8
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_parThis_0024~


{ start parallel [ }
I_parOut_0025~
I_parThis_0025 := I_parThis_0024
{ MOVE element }
if (I_parThis_0025)
U_alrmvar := 8


if (I_parThis_0025)
I_parOut_0025~~

I_parThis_0025 := I_parThis_0024
{ start series [ }
{ Negated contact }
if (U_Rtextsil8)
I_parThis_0025~


{ MOVE element }
if (I_parThis_0025)
U_smsvar := 8


{ ] finish series }
if (I_parThis_0025)
I_parOut_0025~~

I_parThis_0024 := I_parOut_0025
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0024)
I_parOut_0024~~

I_parThis_0024 := I_rung_top
{ Normal coil }
U_Ralrm8 := I_parThis_0024

if (I_parThis_0024)
I_parOut_0024~~

I_rung_top := I_parOut_0024
{ ] finish parallel }
{ ] finish series }

{ start rung 33 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0026~
I_parThis_0026 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm8)
I_parThis_0026~


{ start parallel [ }
I_parOut_0027~
I_parThis_0027 := I_parThis_0026
{ Contact }
ifnot (INA[U_Xsilencepb])
I_parThis_0027~


if (I_parThis_0027)
I_parOut_0027~~

I_parThis_0027 := I_parThis_0026
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_0027~


if (I_parThis_0027)
I_parOut_0027~~

I_parThis_0026 := I_parOut_0027
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0026)
I_parOut_0026~~

I_parThis_0026 := I_rung_top
{ Contact }
ifnot (U_Ralrmsil8)
I_parThis_0026~


if (I_parThis_0026)
I_parOut_0026~~

I_rung_top := I_parOut_0026
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Ralrmsil8 := I_rung_top

{ ] finish series }

{ start rung 34 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0028~
I_parThis_0028 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm8)
I_parThis_0028~


{ Contact }
ifnot (U_Rtextsil)
I_parThis_0028~


{ ] finish series }
if (I_parThis_0028)
I_parOut_0028~~

I_parThis_0028 := I_rung_top
{ Contact }
ifnot (U_Rtextsil8)
I_parThis_0028~


if (I_parThis_0028)
I_parOut_0028~~

I_rung_top := I_parOut_0028
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Rtextsil8 := I_rung_top

{ ] finish series }

{ start rung 36 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xbilge9])
I_rung_top~


{ Negated contact }
if (INA[U_Xacbilgeloss])
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tdelay9 < 299)
U_Tdelay9++
I_rung_top~

else
U_Tdelay9 := 0


{ Negated contact }
if (U_Ralrmsil9)
I_rung_top~


{ start parallel [ }
I_parOut_0029~
I_parThis_0029 := I_rung_top
{ start series [ }
I_scratch2 := 9
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_parThis_0029~


{ start parallel [ }
I_parOut_002a~
I_parThis_002a := I_parThis_0029
{ MOVE element }
if (I_parThis_002a)
U_alrmvar := 9


if (I_parThis_002a)
I_parOut_002a~~

I_parThis_002a := I_parThis_0029
{ start series [ }
{ Negated contact }
if (U_Rtextsil9)
I_parThis_002a~


{ MOVE element }
if (I_parThis_002a)
U_smsvar := 9


{ ] finish series }
if (I_parThis_002a)
I_parOut_002a~~

I_parThis_0029 := I_parOut_002a
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0029)
I_parOut_0029~~

I_parThis_0029 := I_rung_top
{ Normal coil }
U_Ralrm9 := I_parThis_0029

if (I_parThis_0029)
I_parOut_0029~~

I_rung_top := I_parOut_0029
{ ] finish parallel }
{ ] finish series }

{ start rung 37 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_002b~
I_parThis_002b := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm9)
I_parThis_002b~


{ start parallel [ }
I_parOut_002c~
I_parThis_002c := I_parThis_002b
{ Contact }
ifnot (INA[U_Xsilencepb])
I_parThis_002c~


if (I_parThis_002c)
I_parOut_002c~~

I_parThis_002c := I_parThis_002b
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_002c~


if (I_parThis_002c)
I_parOut_002c~~

I_parThis_002b := I_parOut_002c
{ ] finish parallel }
{ ] finish series }
if (I_parThis_002b)
I_parOut_002b~~

I_parThis_002b := I_rung_top
{ Contact }
ifnot (U_Ralrmsil9)
I_parThis_002b~


if (I_parThis_002b)
I_parOut_002b~~

I_rung_top := I_parOut_002b
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Ralrmsil9 := I_rung_top

{ ] finish series }

{ start rung 38 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_002d~
I_parThis_002d := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm9)
I_parThis_002d~


{ Contact }
ifnot (U_Rtextsil)
I_parThis_002d~


{ ] finish series }
if (I_parThis_002d)
I_parOut_002d~~

I_parThis_002d := I_rung_top
{ Contact }
ifnot (U_Rtextsil9)
I_parThis_002d~


if (I_parThis_002d)
I_parOut_002d~~

I_rung_top := I_parOut_002d
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Rtextsil9 := I_rung_top

{ ] finish series }

{ start rung 40 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xacbilgeloss])
I_rung_top~


{ Contact }
ifnot (INA[U_Xbilge4])
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tdelay10 < 299)
U_Tdelay10++
I_rung_top~

else
U_Tdelay10 := 0


{ Negated contact }
if (U_Ralrmsil10)
I_rung_top~


{ start parallel [ }
I_parOut_002e~
I_parThis_002e := I_rung_top
{ start series [ }
I_scratch2 := 10
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_parThis_002e~


{ start parallel [ }
I_parOut_002f~
I_parThis_002f := I_parThis_002e
{ MOVE element }
if (I_parThis_002f)
U_alrmvar := 10


if (I_parThis_002f)
I_parOut_002f~~

I_parThis_002f := I_parThis_002e
{ start series [ }
{ Negated contact }
if (U_Rtextsil10)
I_parThis_002f~


{ MOVE element }
if (I_parThis_002f)
U_smsvar := 10


{ ] finish series }
if (I_parThis_002f)
I_parOut_002f~~

I_parThis_002e := I_parOut_002f
{ ] finish parallel }
{ ] finish series }
if (I_parThis_002e)
I_parOut_002e~~

I_parThis_002e := I_rung_top
{ Normal coil }
U_Ralrm10 := I_parThis_002e

if (I_parThis_002e)
I_parOut_002e~~

I_rung_top := I_parOut_002e
{ ] finish parallel }
{ ] finish series }

{ start rung 41 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0030~
I_parThis_0030 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm10)
I_parThis_0030~


{ start parallel [ }
I_parOut_0031~
I_parThis_0031 := I_parThis_0030
{ Contact }
ifnot (INA[U_Xsilencepb])
I_parThis_0031~


if (I_parThis_0031)
I_parOut_0031~~

I_parThis_0031 := I_parThis_0030
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_0031~


if (I_parThis_0031)
I_parOut_0031~~

I_parThis_0030 := I_parOut_0031
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0030)
I_parOut_0030~~

I_parThis_0030 := I_rung_top
{ Contact }
ifnot (U_Ralrmsil10)
I_parThis_0030~


if (I_parThis_0030)
I_parOut_0030~~

I_rung_top := I_parOut_0030
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Ralrmsil10 := I_rung_top

{ ] finish series }

{ start rung 42 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0032~
I_parThis_0032 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm10)
I_parThis_0032~


{ Contact }
ifnot (U_Rtextsil)
I_parThis_0032~


{ ] finish series }
if (I_parThis_0032)
I_parOut_0032~~

I_parThis_0032 := I_rung_top
{ Contact }
ifnot (U_Rtextsil10)
I_parThis_0032~


if (I_parThis_0032)
I_parOut_0032~~

I_rung_top := I_parOut_0032
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Rtextsil10 := I_rung_top

{ ] finish series }

{ start rung 44 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xacbilgeloss])
I_rung_top~


{ Contact }
ifnot (INA[U_Xbilge2])
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tdelay11 < 9)
U_Tdelay11++
I_rung_top~

else
U_Tdelay11 := 0


{ Negated contact }
if (U_Ralrmsil11)
I_rung_top~


{ start parallel [ }
I_parOut_0033~
I_parThis_0033 := I_rung_top
{ start series [ }
I_scratch2 := 11
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_parThis_0033~


{ start parallel [ }
I_parOut_0034~
I_parThis_0034 := I_parThis_0033
{ MOVE element }
if (I_parThis_0034)
U_alrmvar := 11


if (I_parThis_0034)
I_parOut_0034~~

I_parThis_0034 := I_parThis_0033
{ start series [ }
{ Negated contact }
if (U_Rtextsil11)
I_parThis_0034~


{ MOVE element }
if (I_parThis_0034)
U_smsvar := 11


{ ] finish series }
if (I_parThis_0034)
I_parOut_0034~~

I_parThis_0033 := I_parOut_0034
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0033)
I_parOut_0033~~

I_parThis_0033 := I_rung_top
{ Normal coil }
U_Ralrm11 := I_parThis_0033

if (I_parThis_0033)
I_parOut_0033~~

I_rung_top := I_parOut_0033
{ ] finish parallel }
{ ] finish series }

{ start rung 45 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0035~
I_parThis_0035 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm11)
I_parThis_0035~


{ start parallel [ }
I_parOut_0036~
I_parThis_0036 := I_parThis_0035
{ Contact }
ifnot (INA[U_Xsilencepb])
I_parThis_0036~


if (I_parThis_0036)
I_parOut_0036~~

I_parThis_0036 := I_parThis_0035
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_0036~


if (I_parThis_0036)
I_parOut_0036~~

I_parThis_0035 := I_parOut_0036
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0035)
I_parOut_0035~~

I_parThis_0035 := I_rung_top
{ Contact }
ifnot (U_Ralrmsil11)
I_parThis_0035~


if (I_parThis_0035)
I_parOut_0035~~

I_rung_top := I_parOut_0035
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Ralrmsil11 := I_rung_top

{ ] finish series }

{ start rung 46 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0037~
I_parThis_0037 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm11)
I_parThis_0037~


{ Contact }
ifnot (U_Rtextsil)
I_parThis_0037~


{ ] finish series }
if (I_parThis_0037)
I_parOut_0037~~

I_parThis_0037 := I_rung_top
{ Contact }
ifnot (U_Rtextsil11)
I_parThis_0037~


if (I_parThis_0037)
I_parOut_0037~~

I_rung_top := I_parOut_0037
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Rtextsil11 := I_rung_top

{ ] finish series }

{ start rung 48 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xacbilgeloss])
I_rung_top~


{ Contact }
ifnot (INA[U_Xbilge8])
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tdelay12 < 11999)
U_Tdelay12++
I_rung_top~

else
U_Tdelay12 := 0


{ Negated contact }
if (U_Ralrmsil12)
I_rung_top~


{ start parallel [ }
I_parOut_0038~
I_parThis_0038 := I_rung_top
{ start series [ }
I_scratch2 := 12
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_parThis_0038~


{ start parallel [ }
I_parOut_0039~
I_parThis_0039 := I_parThis_0038
{ MOVE element }
if (I_parThis_0039)
U_alrmvar := 12


if (I_parThis_0039)
I_parOut_0039~~

I_parThis_0039 := I_parThis_0038
{ start series [ }
{ Negated contact }
if (U_Rtextsil12)
I_parThis_0039~


{ MOVE element }
if (I_parThis_0039)
U_smsvar := 12


{ ] finish series }
if (I_parThis_0039)
I_parOut_0039~~

I_parThis_0038 := I_parOut_0039
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0038)
I_parOut_0038~~

I_parThis_0038 := I_rung_top
{ Normal coil }
U_Ralrm12 := I_parThis_0038

if (I_parThis_0038)
I_parOut_0038~~

I_rung_top := I_parOut_0038
{ ] finish parallel }
{ ] finish series }

{ start rung 49 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_003a~
I_parThis_003a := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm12)
I_parThis_003a~


{ start parallel [ }
I_parOut_003b~
I_parThis_003b := I_parThis_003a
{ Contact }
ifnot (INA[U_Xsilencepb])
I_parThis_003b~


if (I_parThis_003b)
I_parOut_003b~~

I_parThis_003b := I_parThis_003a
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_003b~


if (I_parThis_003b)
I_parOut_003b~~

I_parThis_003a := I_parOut_003b
{ ] finish parallel }
{ ] finish series }
if (I_parThis_003a)
I_parOut_003a~~

I_parThis_003a := I_rung_top
{ Contact }
ifnot (U_Ralrmsil12)
I_parThis_003a~


if (I_parThis_003a)
I_parOut_003a~~

I_rung_top := I_parOut_003a
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Ralrmsil12 := I_rung_top

{ ] finish series }

{ start rung 50 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_003c~
I_parThis_003c := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm12)
I_parThis_003c~


{ Contact }
ifnot (U_Rtextsil)
I_parThis_003c~


{ ] finish series }
if (I_parThis_003c)
I_parOut_003c~~

I_parThis_003c := I_rung_top
{ Contact }
ifnot (U_Rtextsil12)
I_parThis_003c~


if (I_parThis_003c)
I_parOut_003c~~

I_rung_top := I_parOut_003c
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Rtextsil12 := I_rung_top

{ ] finish series }

{ start rung 52 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xacbilgeloss])
I_rung_top~


{ Contact }
ifnot (INA[U_Xbilge9])
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tdelay13 < 299)
U_Tdelay13++
I_rung_top~

else
U_Tdelay13 := 0


{ Negated contact }
if (U_Ralrmsil13)
I_rung_top~


{ start parallel [ }
I_parOut_003d~
I_parThis_003d := I_rung_top
{ start series [ }
I_scratch2 := 13
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_parThis_003d~


{ start parallel [ }
I_parOut_003e~
I_parThis_003e := I_parThis_003d
{ MOVE element }
if (I_parThis_003e)
U_alrmvar := 13


if (I_parThis_003e)
I_parOut_003e~~

I_parThis_003e := I_parThis_003d
{ start series [ }
{ Negated contact }
if (U_Rtextsil13)
I_parThis_003e~


{ MOVE element }
if (I_parThis_003e)
U_smsvar := 13


{ ] finish series }
if (I_parThis_003e)
I_parOut_003e~~

I_parThis_003d := I_parOut_003e
{ ] finish parallel }
{ ] finish series }
if (I_parThis_003d)
I_parOut_003d~~

I_parThis_003d := I_rung_top
{ Normal coil }
U_Ralrm13 := I_parThis_003d

if (I_parThis_003d)
I_parOut_003d~~

I_rung_top := I_parOut_003d
{ ] finish parallel }
{ ] finish series }

{ start rung 53 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_003f~
I_parThis_003f := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm13)
I_parThis_003f~


{ start parallel [ }
I_parOut_0040~
I_parThis_0040 := I_parThis_003f
{ Contact }
ifnot (INA[U_Xsilencepb])
I_parThis_0040~


if (I_parThis_0040)
I_parOut_0040~~

I_parThis_0040 := I_parThis_003f
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_0040~


if (I_parThis_0040)
I_parOut_0040~~

I_parThis_003f := I_parOut_0040
{ ] finish parallel }
{ ] finish series }
if (I_parThis_003f)
I_parOut_003f~~

I_parThis_003f := I_rung_top
{ Contact }
ifnot (U_Ralrmsil13)
I_parThis_003f~


if (I_parThis_003f)
I_parOut_003f~~

I_rung_top := I_parOut_003f
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Ralrmsil13 := I_rung_top

{ ] finish series }

{ start rung 54 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0041~
I_parThis_0041 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm13)
I_parThis_0041~


{ Contact }
ifnot (U_Rtextsil)
I_parThis_0041~


{ ] finish series }
if (I_parThis_0041)
I_parOut_0041~~

I_parThis_0041 := I_rung_top
{ Contact }
ifnot (U_Rtextsil13)
I_parThis_0041~


if (I_parThis_0041)
I_parOut_0041~~

I_rung_top := I_parOut_0041
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Rtextsil13 := I_rung_top

{ ] finish series }

{ start rung 56 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xfaalarm])
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tdelay14 < 9)
U_Tdelay14++
I_rung_top~

else
U_Tdelay14 := 0


{ Negated contact }
if (U_Rfahornsil)
I_rung_top~


{ start parallel [ }
I_parOut_0042~
I_parThis_0042 := I_rung_top
{ start series [ }
I_scratch2 := 14
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_parThis_0042~


{ start parallel [ }
I_parOut_0043~
I_parThis_0043 := I_parThis_0042
{ MOVE element }
if (I_parThis_0043)
U_alrmvar := 14


if (I_parThis_0043)
I_parOut_0043~~

I_parThis_0043 := I_parThis_0042
{ start series [ }
{ Negated contact }
if (U_Rtextsil14)
I_parThis_0043~


{ MOVE element }
if (I_parThis_0043)
U_smsvar := 14


{ ] finish series }
if (I_parThis_0043)
I_parOut_0043~~

I_parThis_0042 := I_parOut_0043
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0042)
I_parOut_0042~~

I_parThis_0042 := I_rung_top
{ Normal coil }
U_Ralrm14 := I_parThis_0042

if (I_parThis_0042)
I_parOut_0042~~

I_rung_top := I_parOut_0042
{ ] finish parallel }
{ ] finish series }

{ start rung 57 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0044~
I_parThis_0044 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm14)
I_parThis_0044~


{ start parallel [ }
I_parOut_0045~
I_parThis_0045 := I_parThis_0044
{ Contact }
ifnot (INA[U_Xsilencepb])
I_parThis_0045~


if (I_parThis_0045)
I_parOut_0045~~

I_parThis_0045 := I_parThis_0044
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_0045~


if (I_parThis_0045)
I_parOut_0045~~

I_parThis_0044 := I_parOut_0045
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0044)
I_parOut_0044~~

I_parThis_0044 := I_rung_top
{ Contact }
ifnot (OUTA[U_Yfahornsil])
I_parThis_0044~


if (I_parThis_0044)
I_parOut_0044~~

I_rung_top := I_parOut_0044
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
OUTA[U_Yfahornsil] := I_rung_top

{ ] finish series }

{ start rung 58 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0046~
I_parThis_0046 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm14)
I_parThis_0046~


{ Contact }
ifnot (U_Rtextsil)
I_parThis_0046~


{ ] finish series }
if (I_parThis_0046)
I_parOut_0046~~

I_parThis_0046 := I_rung_top
{ Contact }
ifnot (U_Rtextsil14)
I_parThis_0046~


if (I_parThis_0046)
I_parOut_0046~~

I_rung_top := I_parOut_0046
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Rtextsil14 := I_rung_top

{ ] finish series }

{ start rung 59 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xfatrouble])
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tdelay15 < 9)
U_Tdelay15++
I_rung_top~

else
U_Tdelay15 := 0


{ Negated contact }
if (U_Ralrmsil15)
I_rung_top~


{ start parallel [ }
I_parOut_0047~
I_parThis_0047 := I_rung_top
{ start series [ }
I_scratch2 := 15
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_parThis_0047~


{ MOVE element }
if (I_parThis_0047)
U_statvar := 1


{ ] finish series }
if (I_parThis_0047)
I_parOut_0047~~

I_parThis_0047 := I_rung_top
{ Normal coil }
U_Ralrm15 := I_parThis_0047

if (I_parThis_0047)
I_parOut_0047~~

I_rung_top := I_parOut_0047
{ ] finish parallel }
{ ] finish series }

{ start rung 60 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_0048~
I_parThis_0048 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm15)
I_parThis_0048~


{ start parallel [ }
I_parOut_0049~
I_parThis_0049 := I_parThis_0048
{ Contact }
ifnot (INA[U_Xsilencepb])
I_parThis_0049~


if (I_parThis_0049)
I_parOut_0049~~

I_parThis_0049 := I_parThis_0048
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_0049~


if (I_parThis_0049)
I_parOut_0049~~

I_parThis_0048 := I_parOut_0049
{ ] finish parallel }
{ ] finish series }
if (I_parThis_0048)
I_parOut_0048~~

I_parThis_0048 := I_rung_top
{ Contact }
ifnot (U_Ralrmsil15)
I_parThis_0048~


if (I_parThis_0048)
I_parOut_0048~~

I_rung_top := I_parOut_0048
{ ] finish parallel }
{ Negated contact }
if (U_Rsysreset)
I_rung_top~


{ Normal coil }
U_Ralrmsil15 := I_rung_top

{ ] finish series }

{ start rung 62 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xportpwrbreaker])
I_rung_top~


I_scratch2 := 16
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_rung_top~


{ MOVE element }
if (I_rung_top)
U_statvar := 2


{ ] finish series }

{ start rung 63 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xportprwloss])
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tdelay16 < 11999)
U_Tdelay16++
I_rung_top~

else
U_Tdelay16 := 0


I_scratch2 := 17
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_rung_top~


{ MOVE element }
if (I_rung_top)
U_statvar := 3


{ ] finish series }

{ start rung 64 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (INA[U_Xacbilgeloss])
I_rung_top~


I_scratch2 := 18
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_rung_top~


{ MOVE element }
if (I_rung_top)
U_statvar := 4


{ ] finish series }

{ start rung 66 }
I_rung_top := I_mcr

{ start series [ }
I_scratch2 := 19
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_rung_top~


I_scratch2 := 1
{ GEQ element }
if (I_scratch2 > U_smsvar)
I_rung_top~


{ OSR element }
I_scratch := I_rung_top
if (I_oneShot_0001)
I_rung_top~

I_oneShot_0001 := I_scratch

{ start parallel [ }
I_parOut_004a~
I_parThis_004a := I_rung_top
{ Normal coil }
U_Rtextsil := I_parThis_004a

if (I_parThis_004a)
I_parOut_004a~~

I_parThis_004a := I_rung_top
{ MOVE element }
if (I_parThis_004a)
U_smsvar := 0


if (I_parThis_004a)
I_parOut_004a~~

I_rung_top := I_parOut_004a
{ ] finish parallel }
{ ] finish series }

{ start rung 68 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_004b~
I_parThis_004b := I_rung_top
{ Contact }
ifnot (U_Ralrm1)
I_parThis_004b~


if (I_parThis_004b)
I_parOut_004b~~

I_parThis_004b := I_rung_top
{ Contact }
ifnot (U_Ralrm4)
I_parThis_004b~


if (I_parThis_004b)
I_parOut_004b~~

I_parThis_004b := I_rung_top
{ Contact }
ifnot (U_Ralrm5)
I_parThis_004b~


if (I_parThis_004b)
I_parOut_004b~~

I_parThis_004b := I_rung_top
{ Contact }
ifnot (U_Ralrm9)
I_parThis_004b~


if (I_parThis_004b)
I_parOut_004b~~

I_parThis_004b := I_rung_top
{ Contact }
ifnot (U_Ralrm10)
I_parThis_004b~


if (I_parThis_004b)
I_parOut_004b~~

I_parThis_004b := I_rung_top
{ Contact }
ifnot (U_Ralrm11)
I_parThis_004b~


if (I_parThis_004b)
I_parOut_004b~~

I_parThis_004b := I_rung_top
{ Contact }
ifnot (U_Ralrm12)
I_parThis_004b~


if (I_parThis_004b)
I_parOut_004b~~

I_parThis_004b := I_rung_top
{ Contact }
ifnot (U_Ralrm13)
I_parThis_004b~


if (I_parThis_004b)
I_parOut_004b~~

I_parThis_004b := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrml2)
I_parThis_004b~


{ Contact }
ifnot (U_Ralrm3)
I_parThis_004b~


{ ] finish series }
if (I_parThis_004b)
I_parOut_004b~~

I_parThis_004b := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralrm6)
I_parThis_004b~


{ Contact }
ifnot (U_Ralrm7)
I_parThis_004b~


{ Contact }
ifnot (U_Ralrm8)
I_parThis_004b~


{ ] finish series }
if (I_parThis_004b)
I_parOut_004b~~

I_rung_top := I_parOut_004b
{ ] finish parallel }
{ Set only coil }
if (I_rung_top)
U_Ralarm~~


{ ] finish series }

{ start rung 69 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (U_Ralarm)
I_rung_top~


{ start parallel [ }
I_parOut_004c~
I_parThis_004c := I_rung_top
{ Contact }
ifnot (INA[U_Xsilencepb])
I_parThis_004c~


if (I_parThis_004c)
I_parOut_004c~~

I_parThis_004c := I_rung_top
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_004c~


if (I_parThis_004c)
I_parOut_004c~~

I_rung_top := I_parOut_004c
{ ] finish parallel }
{ Reset only coil }
if (I_rung_top)
U_Ralarm~


{ ] finish series }

{ start rung 70 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (U_Ralarm)
I_rung_top~


{ Negated contact }
if (U_Rflash)
I_rung_top~


{ TON element }
if (I_rung_top)
if (U_Tflashon < 99)
U_Tflashon++
I_rung_top~

else
U_Tflashon := 0


{ TOFF element }
ifnot (I_Tflashoff_antiglitch)
U_Tflashoff := 99

I_Tflashoff_antiglitch~~
ifnot (I_rung_top)
if (U_Tflashoff < 99)
U_Tflashoff++
I_rung_top~~

else
U_Tflashoff := 0


{ Normal coil }
U_Rflash := I_rung_top

{ ] finish series }

{ start rung 71 }
I_rung_top := I_mcr

{ start series [ }
{ Contact }
ifnot (U_Rflash)
I_rung_top~


{ Normal coil }
OUTA[U_Yalrmbuzzer] := I_rung_top

{ ] finish series }

{ start rung 72 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_004d~
I_parThis_004d := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Ralarm)
I_parThis_004d~


{ Contact }
ifnot (U_Rflash)
I_parThis_004d~


{ ] finish series }
if (I_parThis_004d)
I_parOut_004d~~

I_parThis_004d := I_rung_top
{ start series [ }
{ Negated contact }
if (U_Ralarm)
I_parThis_004d~


I_scratch2 := 1
{ GEQ element }
if (I_scratch2 > U_alrmvar)
I_parThis_004d~


{ ] finish series }
if (I_parThis_004d)
I_parOut_004d~~

I_rung_top := I_parOut_004d
{ ] finish parallel }
{ Normal coil }
OUTA[U_Yalarmlt] := I_rung_top

{ ] finish series }

{ start rung 74 }
I_rung_top := I_mcr

{ start series [ }
{ start parallel [ }
I_parOut_004e~
I_parThis_004e := I_rung_top
{ Contact }
ifnot (INA[U_Xresetpb])
I_parThis_004e~


if (I_parThis_004e)
I_parOut_004e~~

I_parThis_004e := I_rung_top
I_scratch2 := 1
{ EQU element }
if (U_resetvar == I_scratch2)
else
I_parThis_004e~


if (I_parThis_004e)
I_parOut_004e~~

I_rung_top := I_parOut_004e
{ ] finish parallel }
I_scratch2 := 1
{ GEQ element }
if (I_scratch2 > U_alrmvar)
I_rung_top~


{ start parallel [ }
I_parOut_004f~
I_parThis_004f := I_rung_top
{ MOVE element }
if (I_parThis_004f)
U_alrmvar := 0


if (I_parThis_004f)
I_parOut_004f~~

I_parThis_004f := I_rung_top
{ Normal coil }
U_Rsysreset := I_parThis_004f

if (I_parThis_004f)
I_parOut_004f~~

I_rung_top := I_parOut_004f
{ ] finish parallel }
{ ] finish series }

{ start rung 75 }
I_rung_top := I_mcr

{ start series [ }
I_scratch2 := 20
{ EQU element }
if (U_Cshift == I_scratch2)
else
I_rung_top~


{ start parallel [ }
I_parOut_0050~
I_parThis_0050 := I_rung_top
{ start series [ }
I_scratch2 := 1
{ EQU element }
if (U_silvar == I_scratch2)
else
I_parThis_0050~


{ MOVE element }
if (I_parThis_0050)
U_silvar := 0


{ ] finish series }
if (I_parThis_0050)
I_parOut_0050~~

I_parThis_0050 := I_rung_top
{ start series [ }
{ Contact }
ifnot (U_Rsysreset)
I_parThis_0050~


{ MOVE element }
if (I_parThis_0050)
U_resetvar := 0


{ ] finish series }
if (I_parThis_0050)
I_parOut_0050~~

I_rung_top := I_parOut_0050
{ ] finish parallel }
{ ] finish series }
waitcnt(timing)
timing += clkfreq / CycleTime
Has, you can see from the code, there is a lot of spin code for the ladder logic program. And, I was wondering since these variables

Ladder Logic Comms Send and Receive Variables: resetvar (System Reset), silvar (System Silence)
Ladder Logic Comms Send Variables: alrmvar (Bilge-F/A), statvar (PWR), smsvar (SMS Messages Future)
are compiled in a Word format, will I need to change them to a Byte so I can passed to my Top Object in order for the communicate with the Spinneret?

I have started on PCB and I am about finished with it and will be ready to have it made. But, have an question to put out there. I have noticed that the Spinneret the bi-directional serial I/O uses an level shifter to handle this task. Is this best circuit for me to use for the bi-directional serial I/O to the Spinneret?

Your ideas are welcome in both areas.

Mike G
04-10-2011, 04:49 PM
... are compiled in a Word format, will I need to change them to a Byte so I can passed to my Top Object in order for the communicate with the Spinneret?


If all the code is running in a single Propeller, which sounds like the case, then simply expose the member in getters and setters, pass the word by value, or use a pointer to reference to the word value. This concept is covered extensively in the Propeller manual. If you are sending the word over serial com then yes the bytes come in one at a time. Usually high byte first.



I have noticed that the Spinneret the bi-directional serial I/O uses an level shifter to handle this task.


Level translation (shifter) means that the signal amplitude is converted from on level to another. For example, 0-5V to 0-3.3V.



Is this best circuit for me to use for the bi-directional serial I/O to the Spinneret?

Not sure... That's up to you and your design. It's more like an out-of-the-box available option.

bsnut
04-12-2011, 05:22 AM
OK, I figure out what I want to do with the serial and how I am going to interface with the RS-485 chip (LTC 1485 or ADM1485). This means I can finish the PCB design and send the board off to be made this week.

I also started on the top object file and noticed a minor codding problem, that I am having problems fixing. When I compile the program, I am getting this error message "Expected end of line" for this ":" in my part of my code

Serial.rx: resetvar
I try even try this as well and it doesn't work:blank:

Serial.rx: resetvar | t

Here is my top object code for everyone to look it.


{{Propeller I/O Controller Top Object file

**************************************
* Propeller_IO_Controller.spin *
* William Stefan *
* Version 0.1 *
**************************************
* See end of file for terms of use. *
**************************************
}}
CON
_clkmode =xtal1+pll16x
_XINFREQ =5_000_000

OBJ

Serial : "Simple_Serial" 'Serial for the Spinneret and RS485
PLC : "ZuniTam Monitoring System" 'Spin PLC code

PUB Initserial 'Initializes serial for the Spinneret and RS485
Serial.init(25, 25, 19200) 'Spinneret Serial Same-Pin (Bi-Directional) True Mode
Serial.init(26, 26, 19200) 'RS485 Serial Same-Pin (Bi-Directional) True Mode

PUB Initplc 'Initializes Spin PLC code
PLC.Start 'Starts Spin PLC code in new cog
waitcnt(clkfreq * 1 + cnt)

pub Main

repeat
Tx_web
waitcnt(clkfreq * 1 + cnt)
Rx_web
waitcnt(clkfreq * 1 + cnt)

PUB Tx_web | t, alarmvar, U_alrmvar, smsvar, U_smsvar 'Bilge/FA Alarms, Pwr Status and SMS Messages (future)
if U_alrmvar >= 1
alarmvar := U_alrmvar
Serial.tx(alarmvar)

if U_smsvar >= 1
smsvar := U_smsvar
Serial.tx(smsvar)
return

PUB Rx_web | t, resetvar, U_resetvar, silvar, U_silvar 'System Reset and Silence
if U_resetvar == 1
resetvar := U_resetvar
Serial.rx: resetvar

if U_silvar == 1
silvar := U_silvar
Serial.rx: silvar
return

I used the Simple_Serial object, which is going to be used for bi-directional serial for the RSS485 chip and the Spinneret. Here is the method for the RX part of the Simple_Serial object where the error being generated at

PUB rx: rxByte | t
{{ Receive a byte; blocks caller until byte received. }}

if rxOkay
dira[sin]~ ' make rx pin an input
waitpeq(inverted & |< sin, |< sin, 0) ' wait for start bit
t := cnt + bitTime >> 1 ' sync + 1/2 bit
repeat 8
waitcnt(t += bitTime) ' wait for middle of bit
rxByte := ina[sin] << 7 | rxByte >> 1 ' sample bit
waitcnt(t + bitTime) ' allow for stop bit

rxByte := (rxByte ^ inverted) & $FF ' adjust for mode and strip off high bits

So, is what is causing this error and now it's not the Simple Serial object. Because I compile it and compiles with no errors.

Mike G
04-12-2011, 01:18 PM
The Rx method returns a value.



resetvar := Serial.rx


The PE manual has excellent Method, COGs, and Objects explanations in chapters 5, and 6

bsnut
04-12-2011, 05:12 PM
Thanks, I should've tried that. I noticed afterwards and didn't think of trying it. That was easy.

bsnut
04-30-2011, 01:19 AM
I like to pass this update on to everyone. The PCB is made and the testing of system will be starting in the middle of May. I will also post the drawing and pics of the PCB for everyone to see by the end of next week.

bsnut
05-22-2011, 08:31 PM
We were testing the Propeller I/O Controller today and ran to a minor problem with the test code. What I am looking for, is someone to test my test file for me to see if they are any problems with.
{{Propeller I/O Controller Top Object file

**************************************
* Propeller_IO_Test.spin *
* William Stefan *
* Version 0.1 *
**************************************
* See end of file for terms of use. *
**************************************
}}
CON
_clkmode =xtal1+pll16x
_XINFREQ =5_000_000


OBJ

pst : "Parallax Serial Terminal" 'Debuging interface
plc : "ZuniTam Monitoring System" 'Spin PLC code

PUB Init
plc.Start 'Starts Spin PLC code in new cog
waitcnt(clkfreq * 1 + cnt)
pst.Start(9600)

PUB Main
repeat
BilgeAlarm_1
BilgeAlarm_2
BilgeAlarm_3
BilgeAlarm_4
BilgeAlarm_5
BilgeAlarm_6
BilgeAlarm_7
BilgeAlarm_8
BilgeAlarm_9
BilgeAlarm_10
BilgeAlarm_11
BilgeAlarm_12
BilgeAlarm_13
Alarm_14
Status_States
Reset_Silence

PUB BilgeAlarm_1 | U_Xbilge1, U_alrmvar
if U_Xbilge1 == 1
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm float 1 on "))

if U_alrmvar == 1
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm 1 "))
return

PUB BilgeAlarm_2 | U_Xbilge2, U_alrmvar
if U_Xbilge2 == 1
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm float 2 on "))

if U_alrmvar == 2
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm 2 "))
return

PUB BilgeAlarm_3 | U_Xbilge3, U_alrmvar
if U_Xbilge3 == 1
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm float 3 on "))

if U_alrmvar == 3
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm 3 "))
return

PUB BilgeAlarm_4 | U_Xbilge4, U_alrmvar
if U_Xbilge4 == 1
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm float 4 on "))

if U_alrmvar == 4
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm 4 "))
return

PUB BilgeAlarm_5 | U_Xbilge5, U_alrmvar
if U_Xbilge5 == 1
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm float 5 on "))

if U_alrmvar == 5
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm 5 "))
return

PUB BilgeAlarm_6 | U_Xbilge6, U_alrmvar
if U_Xbilge6 == 1
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm float 6 on "))

if U_alrmvar == 6
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm 6 "))
return

PUB BilgeAlarm_7 | U_Xbilge7, U_alrmvar
if U_Xbilge7 == 1
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm float 7 on "))

if U_alrmvar == 7
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm 7 "))
return

PUB BilgeAlarm_8 | U_Xbilge8, U_alrmvar
if U_Xbilge8 == 1
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm float 8 on "))

if U_alrmvar == 8
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm 8 "))
return

PUB BilgeAlarm_9 | U_Xbilge9, U_alrmvar
if U_Xbilge9 == 1
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm float 9 on "))

if U_alrmvar == 9
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm 9 "))
return

PUB BilgeAlarm_10 | U_Xbilge4, U_alrmvar, U_Xacbilgeloss
if U_Xbilge4 == 1 and U_Xacbilgeloss == 1
pst.Str(string(pst#CE, pst#HM, "12VDC bilge alarm float 1 on "))

if U_alrmvar == 10
pst.Str(string(pst#CE, pst#HM, "12VDC bilge alarm 1 "))
return

PUB BilgeAlarm_11 | U_Xbilge2, U_alrmvar, U_Xacbilgeloss
if U_Xbilge2 == 1 and U_Xacbilgeloss == 1
pst.Str(string(pst#CE, pst#HM, "12VDC bilge alarm float 2 on "))

if U_alrmvar == 11
pst.Str(string(pst#CE, pst#HM, "12VDC bilge alarm 2 "))
return

PUB BilgeAlarm_12 | U_Xbilge8, U_alrmvar, U_Xacbilgeloss
if U_Xbilge8 == 1 and U_Xacbilgeloss == 1
pst.Str(string(pst#CE, pst#HM, "12VDC bilge alarm float 3 on "))

if U_alrmvar == 12
pst.Str(string(pst#CE, pst#HM, "12VDC bilge alarm 3 "))
return

PUB BilgeAlarm_13 | U_Xbilge9, U_alrmvar, U_Xacbilgeloss
if U_Xbilge9 == 1 and U_Xacbilgeloss == 1
pst.Str(string(pst#CE, pst#HM, "12VDC bilge alarm float 4 on "))

if U_alrmvar == 13
pst.Str(string(pst#CE, pst#HM, "12VDC bilge alarm 4 "))
return

PUB Alarm_14 | U_alrmvar
if U_alrmvar == 14
pst.Str(string(pst#CE, pst#HM, "fire alarm in alarm "))
return

PUB Status_States | U_statvar
if U_statvar == 1
pst.Str(string(pst#CE, pst#HM, "fire alarm in trouble"))

if U_statvar == 2
pst.Str(string(pst#CE, pst#HM, "port power breaker on"))

if U_statvar == 3
pst.Str(string(pst#CE, pst#HM, "port shore power loss"))

if U_statvar == 4
pst.Str(string(pst#CE, pst#HM, "120VAC bilge power loss"))
return

PUB Reset_Silence | U_resetvar, U_silvar
pst.Str(string(pst#CE, pst#HM, "resetvar ="))
pst.Dec(U_resetvar)
U_resetvar := pst.DecIn

pst.Str(string(pst#CE, pst#HM, "silencevar ="))
pst.Dec(U_silvar)
U_silvar := pst.DecIn
return
Note that some inputs need to be trigger for more than 3 seconds

Mike G
05-22-2011, 10:04 PM
William,

I really hope Mike Green sees this post and chimes in, Mike had a knack for explaining this stuff.

Brace yourself... the problem is your understanding of SPIN and SPIN objects.

The "ZuniTam Monitoring System" object does not expose (make visible) its members. That means the test code can not see the VARs in "ZuniTam Monitoring System".

The "Propeller Education Kit Labs-Fundamentals" covers objects in chapters 5 and 6 and can be found in the help drop down of the Propeller tool.

bsnut
05-25-2011, 06:31 AM
Mike,

I noticed a possible problem with the "ZuniTam Monitoring System" object when looking it over yesterday afternoon and why it does not see the VARs. The "ZuniTam Monitoring System" object was compiled with a PRI method instead of a PUB method. I learned this from the Propeller Tool help file and my book called "Programming and Customizing the Multicore Propeller microcontroller. I think this was causing my problem.

Mike G
05-25-2011, 01:15 PM
There is one private method, PRI PlcCycle | timing, in "ZuniTam Monitoring System" but that's ok because the PUB Start method of "ZuniTam Monitoring System" invokes PlcCycle and the "Test" object invoke pcl.Start.

Problem: At run time COG 0 runs out of code at pst.Start. Main is never called. However, the "ZuniTam Monitoring System" is running in COG 1.


PUB Init
plc.Start 'Starts Spin PLC code in new cog
waitcnt(clkfreq * 1 + cnt)
pst.Start(9600)

PUB Main
repeat
BilgeAlarm_1
BilgeAlarm_2
BilgeAlarm_3
BilgeAlarm_4
BilgeAlarm_5
BilgeAlarm_6
BilgeAlarm_7
BilgeAlarm_8
BilgeAlarm_9
BilgeAlarm_10
BilgeAlarm_11
BilgeAlarm_12
BilgeAlarm_13
Alarm_14
Status_States
Reset_Silence


Problem: U_Xbilge1 and U_alrmvar are uninitialized when PUB BilgeAlarm_1 is invoked. Since the scope of U_Xbilge1 and U_alrmvar are within BilgeAlarm, U_Xbilge1 and U_alrmvar are always 0. None of the PUBs in the "Test" code will send data to the terminal because the variables are local to the PUB and never initialized.


PUB BilgeAlarm_1 | U_Xbilge1, U_alrmvar
if U_Xbilge1 == 1
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm float 1 on "))

if U_alrmvar == 1
pst.Str(string(pst#CE, pst#HM, "120VAC bilge alarm 1 "))
return


In "ZuniTam Monitoring System" you have


con
U_Xbilge1 = 5
...
var
WORD U_alrmvar


I believe you want to evaluate U_alrmvar stored in "ZuniTam Monitoring System" from your "Test" code. I'm not sure because there are no comments in your code that describe what's going on. If you want the ability to see U_alrmvar in the top "Test" object then you must expose the VAR through a method or drop U_alrmvar in a DAT section and reference U_alrmvar with a pointer. The following code example exposes U_alrmvar with a method in "ZuniTam Monitoring System"


var
WORD U_alrmvar

PUB getU_alrmvar
return U_alrmvar


Now U_alrmvar is visible to the top "Test" object by...


plc.getU_alrmvar


I don't know if you cracked open chapter 5 and 6 in "Propeller Education Kit Labs-Fundamentals". Chapters 5 and 6 explains in detail the constructs explained above.

bsnut
05-26-2011, 03:00 AM
Thanks for looking at the code. The "ZuniTam Monitoring System" was generated by a ladder logic program called PicOPlc which compile the spin code.
So, what do you think will take care of this problem?

Mike G
05-26-2011, 03:18 AM
Reading chapter 5 and 6 in Propeller Education Kit Labs-Fundamentals would be a good start. Maybe experiment a little with SPIN objects.



The "ZuniTam Monitoring System" was generated by a ladder logic program called PicOPlc which compile the spin code.

The generated code is fine. You just need to tweak it a bit. But first, you must educate yourself in SPIN methods and objects.

bsnut
05-26-2011, 05:13 AM
I did read those chapters of PE and have been reading my new book on the Propeller. I can say that coding without the Propeller itself doesn't help me at all. I just received Propeller this past weekend and need to write some basic code this week.

Thanks again for your support in my project.

Mike G
05-26-2011, 12:49 PM
Go through the PE kit tutorials with your Prop by your side. That will help your understanding.

I said the ZuniTam Monitoring System object is fine. I should have said, the code runs but I don't know if the results are what you expect. There seems to be a lot of cryptic code for monitoring I/O.

bsnut
05-26-2011, 11:25 PM
I said the ZuniTam Monitoring System object is fine. I should have said, the code runs but I don't know if the results are what you expect. There seems to be a lot of cryptic code for monitoring I/O.
I agree with you 100% Mike that's why I am changing the way I code the I/O controller, which I started coding today. Yes, the current code is very cryptic and it is hard for someone to read the spin code compiled by the PicOPlc program. I need to make the project simpler, so the other member of our group who as the Spinneret and in the contest with me can test his coding.

bsnut
07-22-2011, 02:24 AM
The Spinneret Contest is down to the wire for those who entered. I got my new code for me I/O controller working the way I want it too, which will be connected to the Spinneret and started on project docs. I will testing the whole system next week and will post my findings to the forum members after the testing is complete.

bsnut
08-04-2011, 02:12 AM
Since the contest has closed and I didn't get my project submitted on time. I will post my entry for the Web based Ship Monitoring and Control system as per the guidelines set fourth by Parallax. The code for the I/O controller, the Spinneret and the project report will all be posted no later than this time next week. Good luck to those who have entered into this contest.

bsnut
08-08-2011, 02:38 PM
Everyone here is my contest submission for the Spinneret Contest that closed. As they say better late than never.

The following attachments are the
1. Project Report
83838
2. I/O Controller code
83839
3. Spinneret/HTML code
83840

As, I write this me the other member of are group are still working on and testing the final Spinneret/HTML code that will be used in are application. But, I was asked to submit something for the contest anyway by the judges of the contest, so they can judge it anyway.

Prophead100
12-12-2011, 10:07 PM
BS Nut,

FYI - Here is the end code for our ship monitoring...

bsnut
01-25-2012, 06:26 AM
Prophead100, Thanks for posting your code and sorry for not seeing your post until a month later. I take a look at later on today.

bsnut
01-25-2012, 12:48 PM
Prophead100,

Not a bad program that you did and just finished looking it over after coming home from overnight maintenance job.

BTW, For those wondering about the status of my project. We are in a location where it is hard for our volunteers to access the ship, which has made it hard for us to get on the ship to install the monitoring system on board and test it. We hoping to get a spot that is near are current location to tie up and this will us allow better access for members and guests to board the ship safely.

bsnut
09-27-2012, 10:06 PM
For those wondering how we and I am coming along with the Web Based Ship Monitoring System, we haven't gotten very far. The Ship has been in the same spot for the last 18 mouths and if I was able to board the ship safely I would have a chance to test this Spinneret project and have it up and running and it would have detected a leak that flooded our main engine room this past May.

Right now we need to raise $40,000 to make the needed repairs to the hull of our ship and we started a fundraiser on this fundraiser site http://www.razoo.com/story/Help-Save-And-Restore-The-Uss-Zuni-Atf-95-Usgc-Tamaroa-Wmec-166. For those, who are interested in saving a ship with two histories, one that earn her 4 battle stars in the South Pacific in WWII and the other assisted the rescue of the three crewmembers aboard the sailboat Satori during the Perfect Storm in 1991, which latter became a film with the same name.

I would love to see this project completed and see the ship saved for future generations since this is the last chance to save her.

BTW, when you visit the fundraiser site that I started today, there is no video. But, one will be posted and you guys will really like it due to who is narrating it. I will reveal who this person later on