Access a datablock to read stored information

drip

Member
Join Date
Jan 2009
Location
canada
Posts
59
Hello,
I have a little experience with Siemens programming and am now starting a larger project. I am writing a program that will accept a barcode scan a part and its assemblies and will be stored in a datablock. Information that will be taken in is the Part #, Model #, Assembly #, test pass, and time stamp.

These parts will go through 3 small stations and then be scanned at the last station. Parts will not always be in sequence and the order will drastically change from station 1 to station 3. Then in station 3 the part will be scanned and the datablock will have to be called to look up the serial number and confirm if it passed all test.

I have experience creating the blocks and will create a separate datablock for each set of data information. I do not have much experience linking them or searching the data block at station 3 to match the serial codes and look up if it passed or not. I was wondering has any tips or examples to help me get started in the right direction.

Should I create a separate datablock for each parameter and then create a master with the parameters all linked to the serial code? (The test will be done at separate stations so the tank will be scanned at each station and a new parameter added).

What is the best approach to look for the scanned part in the data block. Could I create a pointer that gets incremented comparing each serial number stored in the datablock to the scanned part at the station?

Any help would be greatly appreciated! Thanks!
 
As of right now I do not and I do not have any experience with SCL, but I may be able to get my hands on it if you know of a solution.
 
How would I go about doing it in SCL? I will be on the phone this afternoon with a contact to see if SCL is available. Thanks alot!!!
 
SCL is a pascal like language giving you easy access to arrays of data for example. SCL compiles to STL which you download and run in the plc.
See trivial example below...

Code:
TYPE TankData
  STRUCT
  sPartNumber    : STRING[20]; 
  sAssemblyNumber: STRING[20];
  bTestPass      : BOOL;
  tTimeStamp     : DATE_AND_TIME; 
END_STRUCT
END_TYPE
 
DATA_BLOCK DB100
    STRUCT
Tank :ARRAY[1..10] OF TankData;
    END_STRUCT
BEGIN
END_DATA_BLOCK
FUNCTION_BLOCK FB1 
VAR 
      iLoop:INT;
END_VAR 
//init all passes to false
FOR iLoop:=1 TO 10 DO
 DB100.Tank[iLoop].bTestPass:=False;
END_FOR;   
//////////////////////////////////////////////////////////////     
END_FUNCTION_BLOCK
 
Last edited:
Ok, I see, never was taught anything about SCL before, but it looks and sounds like it can be very useful. I do have access to SCL, and would like to give this a shot as I am always willing to learn and expand. Since I am new to this I will need some help if you guys are willing to help. This will be an on going project for the next week or so and will need to dive into this right away.

PS- I was always a long time reader of this forum and am now just a first time poster and it seems like you guys are very helpful and have great experience! Thanks, it is much appreciated!
 
Lol, it is, but I have the routines in already for the cycle process, and will be starting on this other stuff Monday, and be at it for however long it takes. Next week I start to bring the barcode scans into the program and start with the data tracking.
Once the data is accepted into the program the data will be stored and used at the other stations.
The other stations will add a passed test to the part, until it reaches the final station in which all tests will be looked at to see if it has passed and is a valid part.
Should have SCL by the end of the night.
 

Similar Topics

I have to provide remote access and control to a touch screen. I was thinking about using Weintek and the Weincloud. Does anyone know if this is...
Replies
11
Views
588
Greetings, I am working on a project and I would like to scale %AI to -10.0 to 10.0 VDC. The module Input data is stored as a 16 bit Integer and...
Replies
4
Views
65
Hi all Trying to remotely connect to a TIA Portal PLC. I can ping it without a problem but can't get my software to connect. I've opened port...
Replies
8
Views
312
Hi All, Can anyone advise me on how to determine the AN of a genie instance I writing to. I have created a genie to display a valve and some text...
Replies
0
Views
86
Hello, all, total noob here hoping for a little guidance. I bought a new piece of printing equipment that has a Mitsubishi PLC and this Data...
Replies
7
Views
163
Back
Top Bottom