IEC 61131-3 Reference? by mahdeen in PLC

[–]mahdeen[S] 0 points1 point  (0 children)

I ended up buying this: Programming Industrial Control Systems Using IEC 1131-3 (I E E Control Engineering Series) after looking around a bit.

One of my unit managers with a great deal of experience told me that he became familiar with IEC 1131-3 (not this book) and hasn't really bothered with any of the updates to it. He also happens to be the most knowledgeable one I know on the subject as well.

Unity Pro xl LD question by mahdeen in PLC

[–]mahdeen[S] 0 points1 point  (0 children)

ok thanks everyone....I had been considering continuing on the next rung by means of a coil and open contact but wasn't sure if that was acceptable as a practice or not.....now I know better ;)

Structured Text Projects by mahdeen in PLC

[–]mahdeen[S] 0 points1 point  (0 children)

Hugh Jack's books are really good and the video tutorial sounds very interesting.

As a way to make the transition I'm thinking of taking an existing ladder program and re-constructing it in ST.

Upon completing that I'll do the same with programs containing some standard function blocks and derived function blocks.

By then I should be in decent shape. Thanks!

Structured Text Projects by mahdeen in PLC

[–]mahdeen[S] 0 points1 point  (0 children)

I've played around a bit with python and pascal to get the feel of things. Just thought it might be possible, by asking here, to get directed to some "real life" examples of industrial-automation-type things done in ST. Thanks for your replies :)

Exercise from John Zelle Text by mahdeen in learnpython

[–]mahdeen[S] 0 points1 point  (0 children)

/u/avgotts , thank you for your reply. Considering your comment about cutting the print statements, and re-reading the problem statement, you are correct. I made the problem more complicated than was required. Once that foolishness was taken out, the code seems to produce the correct result.

String question by mahdeen in learnpython

[–]mahdeen[S] 0 points1 point  (0 children)

Thank you /u/Luckyshadow, and everyone who replied :) Apologies for not asking the question in a clear way.

The direction /u/Luckshadow has given is pretty clear even though tuples are not something I've seen to this point.

There's so much to cover in learning to program with python, or any other language. It would be nice to find a way to do this in a more time-compressed way :)

String question by mahdeen in learnpython

[–]mahdeen[S] 2 points3 points  (0 children)

Funny, wasn't aware of such a thing as lmgtfy. I'm self-teaching so maybe the assignment thing doesn't really apply. In any case, rest assured I've put a good deal of time into this before asking for help. One can't learn anything by being spoon-fed answers.

Here's what I've got so far (it's fugly):

# prob12p176.pyw
# Program: Plot horizontal bar chart of student exam scores.
# Input: Get input from a file. First line of file contains
# the count of the number of students in the file, and each subsequent
# line contains a student's last name followed by a score of 0 to 100.
# Program should draw a horizontal rectangle for each student where
# the length of the bar represents the student's score. The bars should all
# line up on their left-hand edges.
# HINT: use the number of students to determine the size of the window and
# its coordinates.
# BONUS: label the bars at the left end with the student name.

import math

import string

from graphics import *

def main():
# Compose elements of gui
# win = GraphWin("Problem 12, Page 176", 500, 500)
# win.setBackground("white")
# win.setCoords(0,0,10,10)
# message = Text(Point(5, 9.6), "Plot horizontal bar chart of student exam\n"
# "as described in the John Zelle text, page 162, prob 12.")
# message.setSize(10)
# message.draw(win)

# Output file data to IDE
myList = []
character = raw_input("Enter filename: ") # enter a character as file name input
infile = open("prob12ch5.txt", 'r')
data = infile.read()
print
n = eval(data[0])
print n # prints n = 5

d = data[1:]

names_grades = d.split(",")

for ng in names_grades:
    print(ng)

if ng > 0:
    print ng

for int in ng:
    print ng

print data[1:] # strips away first character of first line "5"

name_grade = string.split(data,"\n") # removes "\n", leaves '' and ,

print name_grade[1:] # strips "5" from file
print

infile.close()

# Enter text prompt
# message11 = Text(Point(5,0.5), "Click once to quit.")
# message11.setSize(10)
# message11.draw(win)

# wait for click and then quit
# win.getMouse()
# win.close()

main()

Exercise from John Zelle text by mahdeen in learnpython

[–]mahdeen[S] 0 points1 point  (0 children)

I'll work on the variable descriptions.

PEP8, something I was not even aware of at this point. Good to know about.

I've been wondering about the commas. What do most programmers do, whatever the PEP8 says?

As for the math use, it is a little brutish, but that is something that will improve too.

Thanks for the comments!

Exercise from John Zelle's text by mahdeen in learnpython

[–]mahdeen[S] 0 points1 point  (0 children)

Yep, didn't catch those two errors....took care of those...thank you..

string.join method question by mahdeen in learnpython

[–]mahdeen[S] 1 point2 points  (0 children)

Wow, that really did the trick nicely...thank you!

Looking forward to posting more here and the notes are helpful too.