PDA

View Full Version : acquisition of data from a tape perforated



rubano
April 3rd, 2014, 01:35 AM
I have an old machine wrapping electronic maps using programs written on a paper tape, I want to acquire the data from the tape drive perforated with Arduino Uno translate ASCII, then stored in a file on pc directly control the machine with this pc without using perforated strips. I have already started to connect the card reader via the DB25 connector strip with Arduino Uno but I'm stuck in the part of the program concerning the synchronization pulses generated by "sprocket holes".

Do you have an idea on the signal generated by SPKT "sprocket holes"? ie does the data change or not at the time of activation SPKT signal or not?
My tape drive has a reference Eeco.

daver2
April 3rd, 2014, 10:05 AM
Hi,

Eeco is the manufacturer. Somewhere on the machine (the rear?) you should find a model number. That would be useful. I have found a manual from a 'random' Eeco paper tape reader "http://bitsavers.informatik.uni-stuttgart.de/pdf/eeco/DOC11120-01_EECO_TRS9200_Jun79.pdf" that seems to contain the information you are after (see page 2-3 where it states that the data should be sampled when SPROCKET goes to a logic '1'). Be wary of what is meant by logic '1' though. Is it positive or negative logic? Just because this manual states something doesn't mean it is true for the model you have. Try and find the manual for your specific unit if possible.

I would suggest breadboarding the interface to some LED's and feeding some paper tape through the reader and see what the exact timing appears to be for the model that you have. The data holes should change first followed by the sprocket hole if memory serves me correctly.

Dave

tingo
April 3rd, 2014, 02:42 PM
FWIW, the "usual" setup for paper tapes is that the sprocket hole is smaller then the data holes, so you can "clock" off the sprocket hole. Hope this helps.

rubano
April 7th, 2014, 03:54 AM
Eeco is the manufacturer. Somewhere on the machine (the rear?) you should find a model number. That would be useful.

I found just the machine reference is written in French: Numergo (Commande numérique et ergonomie Brevet SERCEL) ie (Numerical control ergonomics and Patent SERCEL)
and on the image below I found written on the datasheet of the tape drive card can be is the reference tape drive:
18202

NeXT
April 7th, 2014, 07:27 AM
The data holes should change first followed by the sprocket hole if memory serves me correctly.

Dave

Yes. The sprocket hole is smaller than the other holes so that when it goes high (or low depending on weather or not the reader uses positive or negative logic) the other holes are perfectly aligned and whatever is capturing the data is clear to input the eight data bits.

MattisLind
April 7th, 2014, 07:35 AM
I have an old machine wrapping electronic maps using programs written on a paper tape, I want to acquire the data from the tape drive perforated with Arduino Uno translate ASCII, then stored in a file on pc directly control the machine with this pc without using perforated strips. I have already started to connect the card reader via the DB25 connector strip with Arduino Uno but I'm stuck in the part of the program concerning the synchronization pulses generated by "sprocket holes".

Do you have an idea on the signal generated by SPKT "sprocket holes"? ie does the data change or not at the time of activation SPKT signal or not?
My tape drive has a reference Eeco.

I am not sure if this is of any use for you. Half a year ago I did a small project to control a DEC PC04 reader using an Arduino board. Have a look here (http://www.datormuseum.se/reading-paper-tapes).

MikeS
April 7th, 2014, 10:40 AM
Here is a program to read PPT using a PC printer port, courtesy Dave Dunfield:
http://www.classiccmp.org/dunfield/img/index.htm

18221

From the Readme:


These are a set of simple utilities I created to recover data from paper tape.

PTR (Paper Tape Reader) reads data from a paper tape reader connected to the
PC printer port and stores it in a raw binary file on the PC. Although designed
and tested with an OAE (Oliver Audio Engineering) OP-80A, it should be able
to work with any reader that presents 8-bits of parallel data, a "Read Data
Available" strobe, and uses an "ACK" pulse to reset for the next byte.

rubano
April 9th, 2014, 01:38 AM
Yes. The sprocket hole is smaller than the other holes so that when it goes high (or low depending on weather or not the reader uses positive or negative logic) the other holes are perfectly aligned and whatever is capturing the data is clear to input the eight data bits.


if I understand the data do not change during the active state of the Strobe signal: ie (the data positioned the strobe is activated and deactivated and the data is changed to the next byte)

rubano
April 9th, 2014, 01:57 AM
I am not sure if this is of any use for you. Half a year ago I did a small project to control a DEC PC04 reader using an Arduino board. Have a look here (http://www.datormuseum.se/reading-paper-tapes).

yeeeeeeeeees Thank you it is very helpful for me and I am trying to understand your code and I wanted first to test a code that I developed on Arduino but the machine is breaking down.since it is the first time I work with Arduino Uno I would have an idea about the pin I need to connect the 8 data bits of the 25-pin tape drive with digital map pins Arduino uno connector, the SPKT (sprocket holes) signal and the signal clk. I would also like to know is that the pin 10 (reverse / reward) is important for data acquisition.Here's a picture of my connector pinout
18237
18238

rubano
April 9th, 2014, 05:50 AM
pt070324.zip
I can not downloaded your zip file there aun message that appears. pt070324.Zip The file is not commonly downloaded file It may be dangerous

rubano
April 9th, 2014, 06:07 AM
Here is a program to read PPT using a PC printer port, courtesy Dave Dunfield:
http://www.classiccmp.org/dunfield/img/index.htm

I can not find the program on the link above. :sad2: :sad2:

MattisLind
April 9th, 2014, 07:45 AM
yeeeeeeeeees Thank you it is very helpful for me and I am trying to understand your code and I wanted first to test a code that I developed on Arduino but the machine is breaking down.since it is the first time I work with Arduino Uno I would have an idea about the pin I need to connect the 8 data bits of the 25-pin tape drive with digital map pins Arduino uno connector, the SPKT (sprocket holes) signal and the signal clk. I would also like to know is that the pin 10 (reverse / reward) is important for data acquisition.Here's a picture of my connector pinout
18237
18238

The code is pretty simple. It is based on how the Digital M840 hardware does it. There are an edge triggered interrupt that detects the sprocket hole. Then it starts a timer which times out after 200 us. Then it samples the data holes and stores them into a buffer. There is a third interrupt routine which generate the control signals for the stepper motor. The main loop just set / resets the some flags to run / stop stepper motor and gets data from the buffer and transmits it to the host.

Do you need to generate pulses on the STEP signal to get it to move? In that case this could be handled by the third ISR (only slightly simplified).

Other than that I think it should work out of the box.

Good luck!

MikeS
April 9th, 2014, 08:00 AM
I can not find the program on the link above. :sad2: :sad2:
PT Paper Tape Tools; last item under Transfer Utilities.

rubano
April 18th, 2014, 07:55 AM
The machine has been repaired and I put the following code contains a condition on the SPKT signal to retrieve the data from the tape card reader before passing to 2 cards inputs / outputs that control the 3 motors step.

After doing tests with this code I found results but I wonder what is the step clock signal importance to the acquisition of data, or just SPKT signal that triggers reading data?

What you said on this code and the condition on the SPKT signal?

unsigned char inPortB,data,oldData,inPortD;
unsigned char strobe,oldStrobe,strobeInactiveState;
unsigned char rotate,parity;
void setup()
{
inPortB=PINB;
inPortD=PIND;
pinMode(2,INPUT); //data= inputs #2..#9
strobe=inPortB&0x04;//input # 10 is always set to 1 for signal SPKT
oldData=data;
oldStrobe=strobe;
strobeInactiveState=strobe;
// protection of different ports 2 tech
PORTD |= 0xFC; // pull-up inputs #2...#7
PORTB |= 0x07; // pull-up inputs #8...#10
Serial.begin(115200);
}
void loop()
{
//read 8 bits of data and strobe (SPKT) bit
inPortB=PINB;
inPortD=PIND;
data= digitalRead(2); //data= inputs #2..#9
strobe=inPortB&0x04;//input # 10 is always set to 1 for signal SPKT
//if datas changed since the last reading
* / / Then the strobe signal is in its inactive state, the reading is repeated
if (oldData != data)
{ strobeInactiveState=strobe;
oldStrobe=strobe;
oldData=data;
return;
}
//if strobe has not changed, then it restarts playback
if(oldStrobe==strobe)
return;
oldStrobe=strobe;
//if the strobe is inactive, then restarts playback
if(strobeInactiveState==strobe)
return;
//calculating the parity bit
rotate=data;//b7 b6 b5 b4 b3 b2 b1 b0
parity=rotate;//b7
rotate <<=1;// Left shift b6 b5 b4 b3 b2 b1 b0 0
parity ^= rotate;//b7 ^ b6
rotate <<=1;// b5 b4 b3 b2 b1 0 0
parity ^= rotate; // b7 ^ b6 ^ b5
rotate <<=1; // two shift positions
parity ^= rotate; // b7 ^ b6 ^ b5 ^ b4
rotate <<=1;// three shift positions
parity ^= rotate; // b7 ^ b6 ^ b5 ^ b4 ^ b3
rotate <<=1; // 4 offset positions
parity ^= rotate; // b7 ^ b6 ^ b5 ^ b4 ^ b3 ^ b2
rotate <<=1;// 5 offset positions
parity ^= rotate; // b7 ^ b6 ^ b5 ^ b4 ^ b3 ^ b2 ^ b1
parity &=0x80; // 6 offset positions
Serial.print("/t x=");
Serial.print(data);
}

rubano
April 18th, 2014, 08:00 AM
I want to initially acquire the data from the tape drive after check is that these data are identical to those in the manual of the perforated band whether I store this data in a database on the PC to be able to control the machine with pc directly.

rubano
April 21st, 2014, 07:27 AM
Hello,
After doing a lot of tests I was finally able to view the data in synchronization with the movement of stepper motors on the serial monitor and view the tape contains beacoup perforations there is one problem: I do not know how for the PC records every data coming from the serial monitor in a text file.

How can I do this with C #.? :onfire:

MattisLind
April 22nd, 2014, 04:41 AM
Hello,
After doing a lot of tests I was finally able to view the data in synchronization with the movement of stepper motors on the serial monitor and view the tape contains beacoup perforations there is one problem: I do not know how for the PC records every data coming from the serial monitor in a text file.

How can I do this with C #.? :onfire:

Maybe this (https://github.com/MattisLind/PC04Reader/blob/master/reader.c) small piece of code could be of any use? It initialise the serial port on a MacOS / BSD machine, but should work in Linux as well I think. I used it when reading paper tapes. If on windows, then you are on your own.

rubano
April 23rd, 2014, 07:47 AM
please help me I'm stuck I can not save the data from the perforated tape saw that there was a huge amount of data with a very high speed. I want that once the tape in the tape drive passes all data acquired by the Arduino uno card go directly to a text file without skipping a bit help me please do it more than 10 days I'm stuck :cry::-x:angry::curse:

tingo
April 24th, 2014, 07:24 AM
What is your setup? Do you have storage on the Arduino (SD card perhaps)?
Or do you need to transfer it to another computer (via serial ore usb)?
Speed should not be an issue; if you want you can do it like this:
read_data (one character / byte);
process_data (save character / byte to file);
send_step_signal();

and repeat until you are one.

MattisLind
April 24th, 2014, 08:18 AM
please help me I'm stuck I can not save the data from the perforated tape saw that there was a huge amount of data with a very high speed. I want that once the tape in the tape drive passes all data acquired by the Arduino uno card go directly to a text file without skipping a bit help me please do it more than 10 days I'm stuck :cry::-x:angry::curse:

Does your Arduino board output something in the Arduino Serial Monitor? Is the data received in the serial monitor correct? Have you checked against the data on the tape?

Many standard terminal programs has a capture facility. Try a standard terminal program and see if you can capture the file there. Then you write a small program to convert it to binary.

rubano
April 25th, 2014, 07:20 AM
What is your setup? Do you have storage on the Arduino (SD card perhaps)?
Or do you need to transfer it to another computer (via serial ore usb)?
Speed should not be an issue; if you want you can do it like this:
read_data (one character / byte);
process_data (save character / byte to file);
send_step_signal();

and repeat until you are one.


Here is my program


int i,j;
int time_spkt=11;
boolean datas[8][24];
void setup()
{
for(i=2;i<10;i++)
{ pinMode(i,INPUT);}
Serial.begin(115200);
}
void loop()
{
while(digitalRead(10)==1);
while(digitalRead(10)==0);
for (j=0;j<24;j++)
{ for (i=0;i<8;i++)
{
datas[i][j]=digitalRead(i+2);

}
delay(time_spkt);
}

for(j=0;j<24;j++)
{ for (i=0;i<8;i++)
{
Serial.print( datas[i][j]);


}
Serial.print("\n");
}
Serial.print("\n ************************************************** ****************");
Serial.print("\n");
delay(5000);
}

it reads the data from the perforated tape, the data is displayed on the serial monitor but since the band contains a large number of bits (there are 600 operations in each transaction there is 192 bits (0 and 1) and I want after using these data for transmission to the machine via the PC now I want that once the data also acquired by the Arduino board they go directly to a text file for record I installed Processing but I n 'unable to develop a program.


I need to transfer data to my PC via the USB serial port of the arduino.

rubano
April 25th, 2014, 07:27 AM
Does your Arduino board output something in the Arduino Serial Monitor? Is the data received in the serial monitor correct? Have you checked against the data on the tape?

Many standard terminal programs has a capture facility. Try a standard terminal program and see if you can capture the file there. Then you write a small program to convert it to binary.



Yep there's binary data that is displayed on the monitor and I compare it with the band and they are identical. Band contains a large amount of data and I want to send in a text file and store it for later control the machine with the data. doing some research on the net I came across Processing is that it's easy to use? Do you have any idea?

rubano
April 25th, 2014, 07:39 AM
Here are the results on the monitor
18465

rubano
May 19th, 2014, 06:45 AM
help me plsss plss
I was able to acquire data from the punched tape and maintennat I want to inject into the machine with the Arduino Uno card to control 3 stepper motors x, y and z. But unfortunately I can not sync with the machine once I inject data acquired using the code below stepper motors do not move. In the program below I use the pedal signal to send data each time you press the pedal must send 24 rows of perforation.


boolean T[192][9]={
{110100101},
{110100101},
{111100111},
{010100111},
{111100111},
{010011101},
{000010101},
{010010111},
{111100111},
{011100101},
{001100111},
{001100111},
{011100101},
{111100111},
{110100101},
{010100111},
{100010111},
{111100111},
{000100101},
{111000101},
{111100111},
{001100111},
{111100111},
{001100111},
{000010101},
{010010111},
{111100111},
{011100101},
{001100111},
{010100111},
{011100101},
{111100111},
{010100111},
{000100101},
{100010111},
{111100111},
{111000101},
{111100111},
{100010111},
{100010111},
{100010111},
{011100101},
{101100101},
{111100111},
{000100101},
{010100111},
{111100111},
{010011101}
};// tableau de 24 lignes et 8 colonnes
// int spkt= 11;
int i,j=0;

void setup()
{

pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);//spkt
pinMode(11,INPUT);//pédale

Serial.begin(115200);
}
void loop()
{
while(digitalRead(11)==0);
{
for(i=j;i<j+24;i++)
{

digitalWrite(2,T[i][0]);
digitalWrite(3,T[i][1]);
digitalWrite(4,T[i][2]);
digitalWrite(5,T[i][3]);
digitalWrite(6,T[i][4]);
digitalWrite(7,T[i][5]);
digitalWrite(8,T[i][6]);
digitalWrite(9,T[i][7]);
digitalWrite(10,T[i][8]);
delay(11);
}

j=j+24;
}
}

daver2
May 24th, 2014, 04:47 AM
Rubano,

The first thing to note is that you have effectively stripped 'time' from what you are doing. Think about how the paper tape is actually working.

1) With the paper tape 'leader' there are no holes - so your setup() function should initialise all the data bits and sprocket signal to '0' (assuming that is the default logical state for these signals when no holes are present).

2) As the tape moves along, first the data signals are presented to the equipment followed a short time later by the sprocket signal, followed a short time later by the sprocket signal being removed, followed a short time later by the data signals being removed, followed a short time later by the next data byte signals being presented.

From what I can see, the only delay you appear to have is between the data bytes themselves [delay(11)].

Also note that the data set for the sprocket holes are always '1' in your data stream. As you already know, the sprocket hole indicates to the equipment that a new (and valid) data byte is present. It does this by looking for a CHANGE IN STATE of the sprocket hole signal (either 0 to 1 or 1 to 0). Your data set always has it as a '1' so the equipment can never see it changing state.

I would suggest deleting the sprocket signal from your data set and only just storing the paper tape data itself. You can now re-write your code as:

Write the first 8 data bits to the pins (using 8 * digitalWrite() as you already have) but NOT the sprocket signal.
delay(t1); // Where t1 is the delay from the data becoming valid to the leading sprocket hole signal.
digitalWrite(10,1); // Set the sprocket active signal.
delay(t2); // Where t2 is the length of time the sprocket signal is valid for.
digitalWrite(10,0); // Clear the sprocket active signal.
delay(t3); // Where t3 is the delay from the sprocket signal being deactivated to the presentation of the next data byte [the equivalent of your delay(11)].

This should let the equipment see exactly the same data stream in the same time ordered sequence that it would as if the paper tape was driving it.

The time delays need to be determined from looking at the actual time delays from your real paper tape reader. They may not be too significant - but equally well if you send the data too fast it may confuse the equipment. You need the delay in between activating and deactivating the sprocket signal to allow the data signal levels to stabilise. This is 'real' electronics and time needs to be allowed for signals to change from 0 to 1 or 1 to 0.

The other thing I noticed is how the pedal signal works. You appear to have a while() loop waiting for input 11 to go TRUE. When you detect the pedal signal going TRUE and you send out your 24 bytes - what happens then? If the pedal signal is still TRUE at this point you will send out another 24 bytes to the machine. Is that what you expected to do? 24 bytes * 11 milliseconds per byte = 264 milliseconds (approximately 1/4 of a second). This means that the operator would have to 'stab' at the pedal to ensure that the ON time was less than 1/4 of a second. Is that what is intended? I suspect not.

You should wait for the pedal to go TRUE before sending the block of data:

while( digitalRead(11) == 0 ) /* Do nothing */ ;

Then send out your 24 bytes of data.

Then wait for the pedal signal to go FALSE:

while( digitalRead(11) == 1 ) /* Do nothing */ ;

Then you should be OK for the next loop. Although I see from your code that the while() checking for the pedal should probably be within the for() loop?

Although my description above is not yet bullet proof as the pedal is probably a switch which will almost certainly suffer from contact bounce. To overcome this you should wait for the signal to go TRUE, then delay a bit, then look at the state of the signal again. If it isn't TRUE this time then go back. Only when the signal is TRUE for both scans should you proceed. Ditto for when you are looking for it to FALSE.

There is a lot to take in here so please ask if it is confusing and I will try and post some code (although I am a C/C++ programmer and have never used an Arduino so I will not be able to guarantee that my code would even compile).

Incidentally, you appear to be using the boolean data type to store your information. The boolean type occupies one byte per data item - of which you are storing 0 or 1 - so you are effectively wasting 7 bits for for each data bit. Use the 'byte' data type instead and store your data as either decimal (in the range 0 to 255) or hexadecimal (0x00 to 0xFF). This will make for a more compact and memory efficient program - but at the expense of not being able to visually compare the holes on the paper tape to the data stream of course. You will also need to modify your program where it writes the data byte out to the Arduino pins.

Dave