JP2019175526A - Magnetic card processing device and method of detecting starting code of magnetic data - Google Patents

Magnetic card processing device and method of detecting starting code of magnetic data Download PDF

Info

Publication number
JP2019175526A
JP2019175526A JP2018062028A JP2018062028A JP2019175526A JP 2019175526 A JP2019175526 A JP 2019175526A JP 2018062028 A JP2018062028 A JP 2018062028A JP 2018062028 A JP2018062028 A JP 2018062028A JP 2019175526 A JP2019175526 A JP 2019175526A
Authority
JP
Japan
Prior art keywords
control unit
start code
magnetic
magnetic card
serial communication
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2018062028A
Other languages
Japanese (ja)
Other versions
JP7033476B2 (en
Inventor
史彦 二村
Fumihiko Nimura
史彦 二村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nidec Sankyo Corp
Original Assignee
Nidec Sankyo Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nidec Sankyo Corp filed Critical Nidec Sankyo Corp
Priority to JP2018062028A priority Critical patent/JP7033476B2/en
Publication of JP2019175526A publication Critical patent/JP2019175526A/en
Application granted granted Critical
Publication of JP7033476B2 publication Critical patent/JP7033476B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Digital Magnetic Recording (AREA)
  • Recording Or Reproducing By Magnetic Means (AREA)

Abstract

To be able to accurately detect a starting code to confirm a position of the starting code in a magnetic card processing device such as a card reader comprising a sub CPU performing a read process and a main CPU performing overall control.SOLUTION: A main CPU and a sub CPU are connected by a serial communication channel, and when detecting a starting code, an output port provided in the sub CPU and connected to the communication channel is switched from a serial communication mode to a general purpose output mode, and an input port provided in the main CPU and connected to the communication channel is switched from the serial communication mode to a general purpose input mode.SELECTED DRAWING: Figure 7

Description

本発明は、磁気カードにおける磁気データの始め符号の検出を行なう磁気カード処理装置と、始め符号の検出方法とに関する。   The present invention relates to a magnetic card processing apparatus for detecting a start code of magnetic data in a magnetic card and a start code detection method.

磁気カードでは、その磁気ストライプの所定位置に始め符号(SS(Start Sentinel);スタートセンチネル)が記録され、それに引き続いて実データが記録される。磁気ストライプにおける始め符号の記録位置は、カード端部を基準とした距離として、JIS(日本工業規格)やISO(国際標準化機関)などの規格によって定められている。磁気カードの所定位置に始め符号を記録するためには、磁気カードの端部の位置を検出する位置センサを設け、位置センサの検出結果に基づいて磁気ヘッドにより始め符号の記録を行うことになるが、位置センサと磁気ヘッドとの間の取り付け誤差などにより、位置センサを基準として記録を行なったときに始め符号の記録位置が規格値からずれることがある。そこで特許文献1は、磁気ヘッドによって始め符号を記録する場合にその記録位置を補正するための補正値を算出する方法を開示している。特許文献1に示される補正値算出方法が適用される磁気カード処理装置すなわちカードリーダは、磁気カードに記録された磁気データの読み取りと磁気カードへの磁気データの記録とを行う磁気ヘッドと、磁気カードを搬送する搬送機構と、磁気カードが磁気ヘッドに到達する前に磁気カードの位置を検出するセンサとを備えている。そして特許文献1の補正値算出方法では、始め符号が正確に記録された標準カードを磁気ヘッドに向かって搬送し、センサが動作した時刻と磁気ヘッドによって標準カードの始め符号が読み込まれた時刻とを求め、それらの時刻の差(時間差T)と記録時のプリアンブル1ビット分のインターバル時間tとを用いてT/tを算出し、このプリアンブル数T/t個を補正値とし、不揮発性メモリに格納している。磁気カードに磁気データを書き込むときは、補正値に基づいて書き込みタイミングを調整することにより、所定位置に始め符号が記録されるようにしている。   In the magnetic card, a code (SS (Start Sentinel)) is recorded at a predetermined position of the magnetic stripe, and actual data is subsequently recorded. The recording position of the start code in the magnetic stripe is determined by a standard such as JIS (Japanese Industrial Standards) or ISO (International Standards Organization) as a distance with respect to the end of the card. In order to record the code at the predetermined position of the magnetic card, a position sensor for detecting the position of the end of the magnetic card is provided, and the code is recorded by the magnetic head based on the detection result of the position sensor. However, due to an attachment error between the position sensor and the magnetic head, the recording position of the code may deviate from the standard value when recording is performed with the position sensor as a reference. Therefore, Patent Document 1 discloses a method of calculating a correction value for correcting a recording position when a code is first recorded by a magnetic head. A magnetic card processing device, that is, a card reader to which the correction value calculation method disclosed in Patent Document 1 is applied includes a magnetic head for reading magnetic data recorded on the magnetic card and recording magnetic data on the magnetic card, A transport mechanism for transporting the card and a sensor for detecting the position of the magnetic card before the magnetic card reaches the magnetic head are provided. In the correction value calculation method of Patent Document 1, the standard card on which the initial code is accurately recorded is conveyed toward the magnetic head, the time when the sensor is operated, and the time when the initial code of the standard card is read by the magnetic head. T / t is calculated using the difference between these times (time difference T) and the interval time t corresponding to one bit of the preamble at the time of recording, and the number of preambles T / t is used as a correction value to obtain a non-volatile memory Is stored. When writing magnetic data to the magnetic card, the code is recorded at a predetermined position by adjusting the write timing based on the correction value.

特開2005−44453号公報JP 2005-44453 A

特許文献1に記載された技術は、標準カードを読み取ったときに始め符号を検出した時刻が正確にわかることが必要であり、単一の制御ユニット(例えばCPU(中央処理装置)など)によって磁気カード処理装置におけるデータ読み出し、データ書き込み及びカード搬送が制御されることを前提とするものである。しかしながら近年、セキュリティ向上などを目的として、磁気ヘッド内部に読み取り処理を実行するサブのCPUを設け、磁気カードから読み出した信号についてサブのCPUによって例えば暗号化処理などの処理を行い、この処理を経たデータをメインのCPUに送る構成とした磁気カード処理装置が普及しつつある。このような磁気カード処理装置では、磁気カード処理装置の全体制御、特にデータ書き込みやカード搬送の制御を実行するメインのCPUと磁気ヘッド内のサブのCPUとの間は、UART(Universal Asynchronous Receiver/Transmitter)、SPI(Serial Peripheral Interface)、I2Cなどの形態のシリアル通信を行う通信路で接続され、両方のCPUの間ではコマンド形式によりデータおよびコマンドがやり取りされる。しかしながら、シリアル通信の通信路によるコマンド形式でのデータ交換であるため、サブCPUにおいて始め符号を検出したことをメインCPUに通知することに遅延が発生し、また、始め符号の検出に関してメインCPUとサブCPUとの間で同期をとることが難しくなる。その結果、上記の時間差Tを正確に決定することが難しくなる。始め符号の検出タイミングの通知のためだけに別個の通信線を設けることも考えられるが、新たな通信線を設けることはコスト面からは好ましくない。 The technique described in Patent Document 1 requires that the time at which a code is first detected when a standard card is read must be accurately known, and a single control unit (for example, a CPU (Central Processing Unit)) magnetically It is assumed that data reading, data writing, and card transport in the card processing device are controlled. However, in recent years, for the purpose of improving security and the like, a sub CPU that executes a reading process is provided inside the magnetic head, and a signal read from the magnetic card is subjected to a process such as an encryption process by the sub CPU. Magnetic card processing devices configured to send data to the main CPU are becoming widespread. In such a magnetic card processing device, a UART (Universal Asynchronous Receiver / Device) is connected between the main CPU that executes the overall control of the magnetic card processing device, particularly the control of data writing and card conveyance, and the sub CPU in the magnetic head. Transmitters, SPIs (Serial Peripheral Interfaces), I 2 C, and other types of serial communication are used for communication, and data and commands are exchanged between both CPUs in a command format. However, since the data is exchanged in the command format through the communication path of the serial communication, there is a delay in notifying the main CPU that the code has been detected at the sub CPU, and the detection of the code at the beginning is delayed. It becomes difficult to synchronize with the sub CPU. As a result, it becomes difficult to accurately determine the time difference T. Although it is conceivable to provide a separate communication line only for notification of the detection timing of the initial code, it is not preferable from the viewpoint of cost to provide a new communication line.

本発明の目的は、全体の制御を行う第1の制御ユニット(例えばメインCPU)と読み取り処理を実行する第2の制御ユニット(例えばサブCPU)とを備える磁気カード処理装置であって、始め符号の位置確認のために始め符号を正確に検出できる磁気カード処理装置と、この磁気カード処理装置における始め符号の検出方法とを提供することにある。   An object of the present invention is a magnetic card processing apparatus including a first control unit (for example, a main CPU) that performs overall control and a second control unit (for example, a sub CPU) that performs reading processing. It is an object of the present invention to provide a magnetic card processing apparatus capable of accurately detecting a start code for the position confirmation and a method of detecting a start code in the magnetic card processing apparatus.

本発明の磁気カード処理装置は、磁気カードに記録された磁気データを読み取って処理を行なう磁気カード処理装置であって、磁気カードに記録された磁気データを読み取る磁気ヘッドと、磁気カードを搬送する搬送機構と、搬送機構により搬送された磁気カードの先端部を検知する検知機構と、検知機構が接続されて搬送機構を制御し、磁気データにおける始め符号の位置を確認する第1の制御ユニットと、磁気ヘッドに接続されるか磁気ヘッドに設けられて磁気ヘッドによって読み取られる磁気データについての処理を実行する第2の制御ユニットと、第1の制御ユニットと第2の制御ユニットとをシリアル通信で接続するために用いられる通信路と、を有し、第1の制御ユニットは、通信路に接続してシリアル通信モードと汎用入力モードとの間で切り替え可能な入力ポートを有し、第2の制御ユニットは、通信路に接続してシリアル通信モードと汎用出力モードとの間で切り替え可能な出力ポートを有し、始め符号の位置の確認のために始め符号を検出するときに、第2の制御ユニットの出力ポートを汎用出力モードとし、第1の制御ユニットの入力ポートを汎用入力モードとする。   A magnetic card processing apparatus according to the present invention is a magnetic card processing apparatus that reads and processes magnetic data recorded on a magnetic card, and carries a magnetic card that reads the magnetic data recorded on the magnetic card, and the magnetic card. A transport mechanism, a detection mechanism that detects the leading end of the magnetic card transported by the transport mechanism, a first control unit that is connected to the detection mechanism and controls the transport mechanism to confirm the position of the start code in the magnetic data; The second control unit, which is connected to the magnetic head or provided on the magnetic head and executes processing on magnetic data read by the magnetic head, and the first control unit and the second control unit are connected by serial communication. The first control unit is connected to the communication path and connected to the serial communication mode and the general-purpose input mode. The second control unit has an output port that can be switched between a serial communication mode and a general-purpose output mode by connecting to a communication path. When a code is first detected for position confirmation, the output port of the second control unit is set to the general-purpose output mode, and the input port of the first control unit is set to the general-purpose input mode.

本発明の磁気データの始め符号の検出方法は、磁気カードに記録された磁気データを読み取る磁気ヘッドと、磁気カードを搬送する搬送機構と、搬送機構により搬送された磁気カードの先端部を検知する検知機構と、検知機構が接続されて搬送機構を制御し、磁気データにおける始め符号の位置を確認する第1の制御ユニットと、磁気ヘッドに接続されるか磁気ヘッドに設けられて磁気ヘッドによって読み取られる磁気データについての処理を実行する第2の制御ユニットと、第1の制御ユニットと第2の制御ユニットとをシリアル通信で接続するために用いられる通信路と、を有する磁気カード処理装置における、磁気データの始め符号の検出方法であって、始め符号を検出するときに、第2の制御ユニットに設けられて通信路に接続する出力ポートをシリアル通信モードから汎用出力モードに切り替え、第1の制御ユニットに設けられて通信路に接続する入力ポートをシリアル通信モードから汎用入力モードに切り替える。   The magnetic data start code detection method according to the present invention detects a magnetic head for reading magnetic data recorded on a magnetic card, a transport mechanism for transporting the magnetic card, and a leading end of the magnetic card transported by the transport mechanism. A detection mechanism, a first control unit for connecting the detection mechanism to control the transport mechanism, and confirming the position of the start code in the magnetic data; and a magnetic head connected to or provided on the magnetic head for reading by the magnetic head In a magnetic card processing device having a second control unit for executing processing on magnetic data to be obtained, and a communication path used for connecting the first control unit and the second control unit by serial communication, A method for detecting a start code of magnetic data, wherein the start code is detected and connected to a communication path provided in a second control unit. Switching power port from the serial communication mode to the general-purpose output mode, it switches the input port connected to the communication path provided to the first control unit from the serial communication mode to the general-purpose input mode.

本発明によれば、磁気カードの先端位置の検知を第1の制御ユニットで行い、磁気カードから読み出した信号に対する処理を第2の制御ユニットで行い、これらの制御ユニットの間をシリアル通信の通信路によって接続する場合において、始め符号の検出を行なうときにはシリアル通信モードから汎用入出力モードに切り替えて通信を行なうことにより、第1の制御ユニット側で始め符号の検出時刻を正確に取得できるようになり、カードの先端部から始め符号の位置までの距離あるいはそれに対応する搬送時間を正確に算出できるようになる。   According to the present invention, the leading end position of the magnetic card is detected by the first control unit, the signal read from the magnetic card is processed by the second control unit, and serial communication is performed between these control units. In the case of connection by a road, when detecting the first code, switching from the serial communication mode to the general-purpose input / output mode to perform communication so that the first code detection time can be accurately acquired on the first control unit side. Thus, the distance from the leading end of the card to the start code position or the corresponding conveyance time can be accurately calculated.

本発明では、始め符号を検出するときに、第1の制御ユニットが、通信路を介して第2の制御ユニットに対して始め符号検出指示のコマンドを送信して入力ポートを汎用入力モードに切り替え、始め符号検出指示のコマンドを受信した第2の制御ユニットが、始め符号の検出を待ち受ける状態に移行するとともに、出力ポートを汎用出力モードに切り替えて出力ポートから第1の信号を出力し、第1の信号を入力ポートで受信した第1の制御ユニットが、搬送機構によって磁気カードの搬送を開始し、検知機構が検知した時刻を記録するようにすることが好ましい。第1の信号としては、例えば、二値信号における一方のレベルの信号を用いられる。これにより、始め符号を検出するタイミングにあわせて、制御ユニット間の通信路を始め符号の検出専用に切り替えることができる。   In the present invention, when the first code is detected, the first control unit transmits a first code detection instruction command to the second control unit via the communication path to switch the input port to the general-purpose input mode. The second control unit that has received the initial code detection instruction command shifts to a state of waiting for the initial code detection, switches the output port to the general-purpose output mode, and outputs the first signal from the output port. Preferably, the first control unit that receives the signal 1 at the input port starts transporting the magnetic card by the transport mechanism and records the time detected by the detection mechanism. As the first signal, for example, a signal of one level in the binary signal is used. As a result, the communication path between the control units can be switched exclusively to the detection of the code in accordance with the timing of detecting the code at the beginning.

本発明では、出力ポートから第1の信号を出力したのち始め符号を検出したときに、第2の制御ユニットが、出力ポートから第1の信号とは異なる第2の信号を出力してそののち出力ポートをシリアル通信モードに切り替え、第2の信号を入力ポートで受信した第1の制御ユニットが、第2の信号を受信した時刻を記録するとともに入力ポートをシリアル通信モードに切り替え、出力ポートをシリアル通信モードに切り替えた第2の制御ユニットが、始め符号の検出が正常に行なえたか否かを第1の制御ユニットに通知し、始め符号の検出が正常に行なえたことを示す通知を受け取った場合に、第1の制御ユニットが、磁気カードへの磁気データの書き込みに際して始め符号を所定の規格の範囲内に書き込むために使用される補正値を算出して補正値をメモリに記録することが好ましい。第2の信号は、例えば、二値信号における、第1の信号とは異なるレベルの信号である。これにより、始め符号を検出した時刻を第1の制御ユニットが遅延なく正確に記録できるようになる。   In the present invention, when the first signal is detected after the first signal is output from the output port, the second control unit outputs a second signal different from the first signal from the output port, and then The output port is switched to the serial communication mode, the time when the first control unit receiving the second signal at the input port records the time when the second signal is received, the input port is switched to the serial communication mode, and the output port is switched to The second control unit that has switched to the serial communication mode notifies the first control unit whether or not the first code has been successfully detected, and has received a notification indicating that the first code has been successfully detected. In this case, the first control unit calculates a correction value used for writing the code within a predetermined standard range when writing the magnetic data to the magnetic card. It is preferable to record a correction value in the memory. The second signal is, for example, a signal having a level different from that of the first signal in the binary signal. As a result, the first control unit can accurately record the time when the first code is detected without delay.

本発明では、第2の制御ユニットが、始め符号の検出の有無に関わらずタイムアウトの発生によってその出力ポートから第2の信号を出力してそののち出力ポートをシリアル通信モードに切り替え、始め符号の検出が正常に行なえなかったことを第1の制御ユニットに通知するようにすることが好ましい。これにより、第2の制御ユニットにおいて始め符号を検出できなかった場合であっても、制御ユニット間でのシリアル通信を回復させることができる。   In the present invention, the second control unit outputs the second signal from the output port when a timeout occurs regardless of whether or not the initial code is detected, and then switches the output port to the serial communication mode. It is preferable to notify the first control unit that the detection could not be performed normally. Thereby, even if it is a case where a code | symbol cannot be detected initially in the 2nd control unit, the serial communication between control units can be recovered.

本発明では、始め符号検出指示のコマンドの送信後または第1の信号の出力後、所定の時間が経過したら、第1の制御ユニットが入力ポートをシリアル通信モードに切り替え、第2の制御ユニットが出力ポートをシリアル通信モードに切り替えることが好ましい。これにより、始め符号を検出できなかった場合であっても、制御ユニット間でのシリアル通信を回復させることができる。   In the present invention, the first control unit switches the input port to the serial communication mode after the predetermined time has elapsed after the transmission of the first code detection instruction command or the output of the first signal, and the second control unit It is preferable to switch the output port to the serial communication mode. Thereby, even if the code cannot be detected at the beginning, the serial communication between the control units can be recovered.

全体の制御を行う第1の制御ユニットと読み取り処理を実行する第2の制御ユニットとを備える磁気カード処理装置であっても、制御ユニット間の通信での遅延や同期の影響を回避して、始め符号の位置の確認のために始め符号を正確に検出できるようになる。   Even in a magnetic card processing device including a first control unit that performs overall control and a second control unit that executes read processing, avoiding the influence of delay and synchronization in communication between control units, The initial code can be accurately detected for confirmation of the position of the initial code.

本発明の実施の一形態の磁気カード処理装置の構成を示す側面図である。It is a side view which shows the structure of the magnetic card processing apparatus of one Embodiment of this invention. 図1に示す磁気カード処理装置の回路構成を示すブロック図である。It is a block diagram which shows the circuit structure of the magnetic card processing apparatus shown in FIG. (a),(b)は、図1に示す磁気カード処理装置の動作を説明する平面図である。(A), (b) is a top view explaining operation | movement of the magnetic card processing apparatus shown in FIG. 始め符号の位置確認方法を示すフローチャートである。It is a flowchart which shows the position confirmation method of a start code | symbol. 補正値算出工程を説明するフローチャートである。It is a flowchart explaining a correction value calculation process. 始め符号位置確認工程を説明するフローチャートである。It is a flowchart explaining a code | symbol position confirmation process first. (a),(b)は、通信路の切り替えを説明する図である。(A), (b) is a figure explaining switching of a communication path. 始め符号の検出の処理を示すシーケンス図である。It is a sequence diagram which shows the process of a start code | symbol detection.

次に、本発明を実施するための形態について、図面を参照して説明する。   Next, modes for carrying out the present invention will be described with reference to the drawings.

(磁気カード処理装置の概略構成)
図1は、本発明の実施の一形態の磁気データ処理装置(カードリーダ)1を示している。この磁気データ処理装置1は、例えばATM(Automated Teller Machine)などの機器に搭載されて、ホストコンピュータなどに接続されてホストコンピュータの指示により磁気カード2に対してデータの書き込みと読み出しとを行うものである。ホストコンピュータは、例えば、パーソナルコンピュータ、サーバーなどの各種の情報処理機器である。磁気カード処理装置1は、磁気カード2に記録された磁気データの読み取りと磁気カード2への磁気データの記録を行う磁気ヘッド3と、磁気カード2を搬送する搬送機構4と、カード2の端部を検知する検知機構5とを備えている。搬送機構4は、モータ9に連結される搬送ローラ7と、搬送ローラ7に対向配置されるとともに搬送ローラ7に向かって付勢されるパッドローラ8とを備えている。磁気カード2は、搬送ローラ7とパッドローラ8との間に挟まれた状態で搬送される。検知機構5は、発光部10と受光部11とを有する透過型の光学式センサとして構成されている。さらに磁気カード処理装置1には、この磁気カード処理装置1の制御を行う制御回路20が設けられている。
(Schematic configuration of magnetic card processing device)
FIG. 1 shows a magnetic data processing device (card reader) 1 according to an embodiment of the present invention. This magnetic data processing device 1 is mounted on a device such as an ATM (Automated Teller Machine), for example, and is connected to a host computer or the like, and writes and reads data to and from the magnetic card 2 according to instructions from the host computer. It is. The host computer is various information processing devices such as a personal computer and a server. The magnetic card processing device 1 includes a magnetic head 3 that reads magnetic data recorded on the magnetic card 2 and records magnetic data on the magnetic card 2, a transport mechanism 4 that transports the magnetic card 2, and an end of the card 2. And a detection mechanism 5 for detecting the part. The transport mechanism 4 includes a transport roller 7 connected to a motor 9, and a pad roller 8 that is disposed facing the transport roller 7 and is biased toward the transport roller 7. The magnetic card 2 is transported while being sandwiched between the transport roller 7 and the pad roller 8. The detection mechanism 5 is configured as a transmissive optical sensor having a light emitting unit 10 and a light receiving unit 11. Further, the magnetic card processing device 1 is provided with a control circuit 20 that controls the magnetic card processing device 1.

図2は、磁気カード処理装置1の電気的な回路構成を示している。制御回路20は、磁気カード処理装置1の全体的な制御、特に、磁気カード2への書き込みの制御と搬送制御とを実行するメインCPU21と、メインCPU21に接続するRAM(ランダムアクセスメモリ)22および不揮発性メモリ23と、メインCPU21から出力される書き込み信号を増幅する増幅回路24と、メインCPU21に接続してメインCPU21からの信号によりモータ9を制御するモータ駆動回路25とを備えている。メインCPU21はホストコンピュータ40に接続し、磁気カード2の端部を検知する検知機構5もメインCPU21に接続している。   FIG. 2 shows an electrical circuit configuration of the magnetic card processing apparatus 1. The control circuit 20 includes a main CPU 21 that performs overall control of the magnetic card processing device 1, in particular, control of writing to the magnetic card 2 and transport control, a RAM (random access memory) 22 connected to the main CPU 21, and A nonvolatile memory 23, an amplifier circuit 24 that amplifies a write signal output from the main CPU 21, and a motor drive circuit 25 that is connected to the main CPU 21 and controls the motor 9 by a signal from the main CPU 21. The main CPU 21 is connected to the host computer 40, and the detection mechanism 5 that detects the end of the magnetic card 2 is also connected to the main CPU 21.

磁気ヘッド3は、磁気ストライプ2aからの磁気データの読み出しに用いられる読み出しヘッド31と、磁気ストライプ2aへの磁気データの書き込みに用いられる書き込みヘッド32とを一体化したものであり、読み出しヘッド31で検出された信号を増幅する増幅回路33も備えている。書き込みヘッド32は、制御回路20に設けられた増幅回路24の出力によって駆動される。さらに本実施形態では、磁気ヘッド3には、読み取り処理用のサブCPU34が設けられている。サブCPU34は、アナログ信号を受け入れてこれをアナログ/デジタル(A/D)変換し、変換後のデジタル信号に対してその場で暗号化処理などを行うことができるように、入力端子A/Dを備えている。入力端子A/Dには、読み出しヘッド31で検出され増幅回路33で増幅された信号が入力する。サブCPU34は読み出しヘッド31からの信号を処理できるのであれば、磁気ヘッド3の外部に設けられて磁気ヘッド3に接続していてもよいが、サブCPU34により暗号化処理などを行なうのであれば、磁気ヘッド3の内部に設けられるか、磁気ヘッド3に対して一体のものとして設けられていることが好ましい。   The magnetic head 3 is formed by integrating a read head 31 used for reading magnetic data from the magnetic stripe 2a and a write head 32 used for writing magnetic data to the magnetic stripe 2a. An amplifying circuit 33 for amplifying the detected signal is also provided. The write head 32 is driven by the output of the amplifier circuit 24 provided in the control circuit 20. Further, in the present embodiment, the magnetic head 3 is provided with a sub CPU 34 for reading processing. The sub CPU 34 receives an analog signal, converts it to analog / digital (A / D), and performs an encryption process or the like on the converted digital signal on the spot. It has. A signal detected by the read head 31 and amplified by the amplifier circuit 33 is input to the input terminal A / D. The sub CPU 34 may be provided outside the magnetic head 3 and connected to the magnetic head 3 as long as the signal from the read head 31 can be processed. However, if the sub CPU 34 performs encryption processing or the like, It is preferable that the magnetic head 3 is provided inside the magnetic head 3 or is provided integrally with the magnetic head 3.

サブCPU34は、メインCPU21から指令によって動作し、メインCPU21に対して処理結果などを通知する。そのため、メインCPU21のインタフェース用の入出力部I/Oと、サブCPU34のインタフェース用の入出力部I/Oとの間は、シリアル通信用の1対の通信線からなる通信路12で接続されている。   The sub CPU 34 operates in response to a command from the main CPU 21 and notifies the main CPU 21 of a processing result and the like. Therefore, the input / output unit I / O for interface of the main CPU 21 and the input / output unit I / O for interface of the sub CPU 34 are connected by a communication path 12 including a pair of communication lines for serial communication. ing.

磁気カード2は、JIS規格やISO規格に準拠したものであって、厚さが0.7〜0.8mm程度の長方形状の塩化ビニール製のものである。磁気カード2には、磁気データが記録される磁気ストライプ2aが、磁気カード2の長手方向に沿って形成されている。磁気カード2には、ICチップが内蔵されていてもよく、データ通信用のアンテナが内蔵されていてもよい。また磁気カード2は、厚さが0.18〜0.36mm程度のPET(ポリエチレンテレフタレート)製のカードであってもよいし、所定の厚さの紙カードなどであってもよい。   The magnetic card 2 conforms to the JIS standard and ISO standard, and is made of rectangular vinyl chloride having a thickness of about 0.7 to 0.8 mm. On the magnetic card 2, a magnetic stripe 2 a on which magnetic data is recorded is formed along the longitudinal direction of the magnetic card 2. The magnetic card 2 may incorporate an IC chip or a data communication antenna. The magnetic card 2 may be a PET (polyethylene terephthalate) card having a thickness of about 0.18 to 0.36 mm, or a paper card having a predetermined thickness.

磁気カード2に記録される磁気データ、すなわち磁気ストライプ2aに記録される磁気データは、プリアンブルと、始め符号(SS)、実データ、終わり符号(ES(End Sentinel);エンドセンチネル)、LRC(Longitudinal Redundancy Check;水平冗長検査)文字、およびポストアンブルの各要素によって構成され、これらの要素は、磁気カード2の長手方向の一端部2bから他端部2cに向かってこの順番で磁気ストライプ2aに記録されている。上述したようにJIS規格やISO規格では、一端部2bを基準とする磁気データの始め符号の位置が規定されている。   The magnetic data recorded on the magnetic card 2, that is, the magnetic data recorded on the magnetic stripe 2a, includes a preamble, a start code (SS), actual data, an end code (ES (End Sentinel)), and an LRC (Longitudinal). Redundancy Check (horizontal redundancy check) is composed of characters and postamble elements, and these elements are recorded in the magnetic stripe 2a in this order from one end 2b in the longitudinal direction of the magnetic card 2 toward the other end 2c. Has been. As described above, in the JIS standard and ISO standard, the position of the start code of the magnetic data with respect to the one end 2b is defined.

図3は、磁気カード処理装置1の動作を説明する平面図である。磁気カード処理装置1において磁気カード2は、その搬送方向(図1および図3での左右方向)とその長手方向とが一致するように、搬送機構4によって搬送される。磁気カード2に記録された磁気データが磁気ヘッド3で読み取られるとき、および、磁気ヘッド3によって磁気カード2に磁気データが記録されるときには、一端部2bが最初に磁気ヘッド3に接触するように、磁気カード2が搬送される。ここで示す例では、一端部2bは、磁気ヘッド3に向かって搬送される磁気カード2の先端部となっている。以降において、この方向に磁気カード2が搬送される方向を順方向とする。   FIG. 3 is a plan view for explaining the operation of the magnetic card processing apparatus 1. In the magnetic card processing apparatus 1, the magnetic card 2 is transported by the transport mechanism 4 so that the transport direction (the left-right direction in FIGS. 1 and 3) coincides with the longitudinal direction. When the magnetic data recorded on the magnetic card 2 is read by the magnetic head 3 and when the magnetic data is recorded on the magnetic card 2 by the magnetic head 3, the one end 2 b comes into contact with the magnetic head 3 first. The magnetic card 2 is conveyed. In the example shown here, the one end 2 b is the tip of the magnetic card 2 that is conveyed toward the magnetic head 3. Hereinafter, the direction in which the magnetic card 2 is conveyed in this direction is referred to as the forward direction.

検知機構5の発光部10と受光部11とは、磁気カード2の搬送路を挟んで対向する位置に配置されている。検知機構5は、磁気カード2に記録された磁気データが磁気ヘッド3で読み取られるとき、記録されている始め符号が磁気ヘッド3に到達する前に、磁気ヘッド3に向かって搬送される磁気カード2の一端部2bを検知する。具体的には、検知機構5は、始め符号が磁気ヘッド3の読み出しヘッド31のギャップに到達する前に、磁気ヘッド3に向かって搬送されるカード2の一端部2bを検知する。図3では、読み出しヘッド31のギャップは、図3においては太線で示されている。図1においては発光部10と受光部11は磁気カード2の搬送方向に関して磁気ヘッド3からずれて配置されているように描かれているが、実際には、図3(a)において破線で示すように、磁気カード読取装置1での設計上、発光部10および受光部11の中心(すなわち検知機構5の中心)と読み出しヘッド31のギャップとは、磁気カード2の搬送方向において同じ位置に配置されるようなっている。また設計上は、磁気カード2に磁気データを記録するときには、検知機構5によって磁気カード2の一端部2bが検知されると、磁気ヘッド3によって、規格で定められたビット数のプリアンブルの記録が開始されるようになっている。   The light emitting unit 10 and the light receiving unit 11 of the detection mechanism 5 are arranged at positions facing each other across the conveyance path of the magnetic card 2. When the magnetic data recorded on the magnetic card 2 is read by the magnetic head 3, the detecting mechanism 5 is a magnetic card that is conveyed toward the magnetic head 3 before the recorded start code reaches the magnetic head 3. 2 one end 2b is detected. Specifically, the detection mechanism 5 detects the one end portion 2 b of the card 2 conveyed toward the magnetic head 3 before the initial code reaches the gap of the read head 31 of the magnetic head 3. In FIG. 3, the gap of the read head 31 is indicated by a bold line in FIG. 3. In FIG. 1, the light emitting unit 10 and the light receiving unit 11 are drawn so as to be displaced from the magnetic head 3 with respect to the conveyance direction of the magnetic card 2, but actually, they are indicated by broken lines in FIG. Thus, in the design of the magnetic card reader 1, the center of the light emitting unit 10 and the light receiving unit 11 (that is, the center of the detection mechanism 5) and the gap of the read head 31 are arranged at the same position in the conveyance direction of the magnetic card 2. It is supposed to be. Also, by design, when recording magnetic data on the magnetic card 2, if the detection mechanism 5 detects the one end 2 b of the magnetic card 2, the magnetic head 3 records a preamble with the number of bits determined by the standard. It is supposed to be started.

しかしながら、磁気ヘッド3や検知機構5の取り付け誤差などの影響で、磁気カード2の搬送方向において磁気ヘッド3の読み出しヘッド31や書き込みヘッド32のギャップと検知機構5の中心とがずれる場合がある。例えば図1や図3において実線で示すように、検知機構5の中心が読み出しヘッド31および書き込みヘッド32のギャップの位置よりも磁気カード2の搬送方向において上流側に位置することがある。磁気カード2の搬送方向においてギャップの位置と検知機構5の中心とがずれていると、磁気カード2に記録される磁気データでの始め符号の位置がずれることになる。具体的には、一端部2bを基準とする始め符号の位置がずれる。   However, the gap between the read head 31 and the write head 32 of the magnetic head 3 and the center of the detection mechanism 5 may be shifted in the transport direction of the magnetic card 2 due to the influence of the mounting error of the magnetic head 3 and the detection mechanism 5. For example, as indicated by a solid line in FIGS. 1 and 3, the center of the detection mechanism 5 may be positioned upstream in the transport direction of the magnetic card 2 from the position of the gap between the read head 31 and the write head 32. If the position of the gap and the center of the detection mechanism 5 are shifted in the conveyance direction of the magnetic card 2, the position of the start code in the magnetic data recorded on the magnetic card 2 is shifted. Specifically, the position of the start code is shifted with respect to the one end 2b.

そこで、本実施形態の磁気カード処理装置1では、出荷前などに、磁気カード2に記録される磁気データの始め符号の位置ずれを抑制するための補正を行っている。また、本実施形態では、補正後に、磁気カード処理装置1によって磁気カード2に磁気データを記録するとともに、磁気カード2に記録された磁気データの始め符号の位置を検出し確認している。以下、補正値の算出工程を含む磁気データの始め符号の位置確認方法を説明する。   Therefore, in the magnetic card processing apparatus 1 of the present embodiment, correction is performed to suppress the positional deviation of the start code of the magnetic data recorded on the magnetic card 2 before shipment. In the present embodiment, after correction, magnetic data is recorded on the magnetic card 2 by the magnetic card processing device 1, and the position of the start code of the magnetic data recorded on the magnetic card 2 is detected and confirmed. Hereinafter, a method for confirming the position of the start code of the magnetic data including the correction value calculation step will be described.

(始め符号の位置確認方法)
図4は、始め符号の位置確認方法を説明するフローチャートであり、図5は、補正値算出工程を示すフローチャートであり、図6は、始め符号位置確認工程を示すフローチャートである。図4に示すように、始め符号の位置確認方法では、ステップ51において補正値算出工程を実行し、次にステップ52において磁気データ記録工程を実行し、最後にステップ53において始め符号位置確認工程を実行する。
(First code position confirmation method)
FIG. 4 is a flowchart for explaining a start code position confirmation method, FIG. 5 is a flowchart showing a correction value calculation process, and FIG. 6 is a flowchart showing a start code position confirmation process. As shown in FIG. 4, in the first code position confirmation method, the correction value calculation process is executed in step 51, the magnetic data recording process is executed in step 52, and finally the code position confirmation process is executed in step 53. Execute.

ステップ51の補正値算出工程では、磁気データが記録されるとともに磁気データの始め符号が正確な位置に記録された磁気カード2である基準カードが使用される。補正値算出工程では、作業員がまず、磁気カード処理装置1に基準カードを挿入する。基準カードが挿入されると、制御回路20内のメインCPU21は、基準カードを搬送機構4によって搬送しながら、基準カードに記録された磁気データを読み取ることを磁気ヘッド3内のサブCPU34に指令する。サブCPU34は、読み出しヘッド31により基準カードから読み出された信号を処理するが、始め符号を検出したときは、その旨をメインCPU21に通知する。そしてメインCPU21は、搬送される基準カードの一端部2bが検知機構5で検知された後、基準カードに記録された磁気データの始め符号が磁気ヘッド3に到達するまでの時間である基準時間t0を算出する。 In the correction value calculation process of step 51, a reference card, which is the magnetic card 2 in which magnetic data is recorded and the start code of the magnetic data is recorded at an accurate position, is used. In the correction value calculation step, an operator first inserts a reference card into the magnetic card processing device 1. When the reference card is inserted, the main CPU 21 in the control circuit 20 instructs the sub CPU 34 in the magnetic head 3 to read the magnetic data recorded on the reference card while carrying the reference card by the carrying mechanism 4. . The sub CPU 34 processes the signal read from the reference card by the read head 31, but when the code is detected at the beginning, the sub CPU 34 notifies the main CPU 21 to that effect. Then, the main CPU 21 detects the reference time t, which is the time until the start code of the magnetic data recorded on the reference card reaches the magnetic head 3 after the detection mechanism 5 detects the one end 2b of the conveyed reference card. Calculate 0 .

具体的には、図5に示すように、メインCPU21は、ステップ101において、基準カードの一端部2bが検知機構5で検知された時刻、すなわち図3(a)に示す状態になった時刻t1をRAM22に記憶し、ステップ102において、サブCPU34からの通知に基づき、基準カードに記録された磁気データの始め符号が磁気ヘッド3の読み出しヘッド31のギャップに到達した時刻、すなわち図3(b)に示す状態になった時刻t2をRAM22に記憶する。その後、メインCPU21は、ステップ103において、RAM22に記憶されている時刻t1と時刻t2とに基づいて、基準時間t0=t2−t1を算出する。 Specifically, as shown in FIG. 5, the main CPU 21 determines in step 101 that the time when the one end 2b of the reference card is detected by the detection mechanism 5, that is, the time t when the state shown in FIG. 1 is stored in the RAM 22, and in step 102, based on the notification from the sub CPU 34, the time when the start code of the magnetic data recorded on the reference card reaches the gap of the read head 31 of the magnetic head 3, that is, FIG. ) the time t 2 that the state shown in stored in RAM 22. Thereafter, in step 103, the main CPU 21 calculates a reference time t 0 = t 2 −t 1 based on the time t 1 and the time t 2 stored in the RAM 22.

基準カードにおける一端部2bと磁気データの始め符号の記録開始位置との距離Lを、搬送機構4によるカード2の搬送速度Vで割った値(L/V)を時間Tとすると、時間Tは、予め、算出可能な固定値である。メインCPU21は、ステップ103の後、ステップ104において、時間Δt0=t0−Tを算出する。すなわちメインCPU21は、基準カードの搬送方向における検知機構5の中心と磁気ヘッド3の読み出しヘッド31のギャップとのずれ量分の距離を基準カードが搬送されるのに要した時間Δt0を算出する。続いてメインCPU21は、基準カードの搬送方向における検知機構5の中心と読み出しヘッド31のギャップとのずれ量X=Δt0×Vを算出する。ずれ量Xは、図3(a)に示されている。磁気ストライプ2aにおけるプリアンブルのビット間の間隔をAとして、メインCPU21は、ステップ106において補正値n=X/Aを算出し、ステップ107において、基準時間t0と補正値nとを不揮発性メモリ23に記憶する。これにより補正値算出工程が終了する。 Assuming that a value (L / V) obtained by dividing the distance L between the one end 2b of the reference card and the recording start position of the start code of the magnetic data by the conveyance speed V of the card 2 by the conveyance mechanism 4 is time T, the time T is These are fixed values that can be calculated in advance. After step 103, the main CPU 21 calculates time Δt 0 = t 0 −T in step 104. That is, the main CPU 21 calculates a time Δt 0 required for the reference card to be transferred by a distance corresponding to a deviation amount between the center of the detection mechanism 5 and the gap of the read head 31 of the magnetic head 3 in the reference card transfer direction. . Subsequently, the main CPU 21 calculates a deviation amount X = Δt 0 × V between the center of the detection mechanism 5 and the gap of the read head 31 in the transport direction of the reference card. The deviation amount X is shown in FIG. The main CPU 21 calculates a correction value n = X / A in step 106, where A is the interval between bits of the preamble in the magnetic stripe 2a. In step 107, the main CPU 21 calculates the reference time t 0 and the correction value n. To remember. Thereby, the correction value calculation step is completed.

次に、ステップ52の磁気データ記録工程について説明する。磁気データ記録工程では、まず、磁気データが記録されていない磁気カード2を作業員が磁気カード処理装置1に挿入する。磁気カード2が磁気カード処理装置1に挿入されると、メインCPU21は、この磁気カード2を搬送機構4によって搬送するとともに、記録用の信号を生成する。記録用の信号は増幅回路24によって増幅されて磁気ヘッド3内の書き込みヘッド32に印加される。これにより磁気カード2に磁気データが記録される。このとき、磁気カード2に記録される始め符号の位置が所定の規格の範囲内となるように、メインCPU21は、不揮発性メモリ23に記憶されている補正値nを使用する。具体的にはメインCPU21は、搬送機構4によって磁気ヘッド3に向かって搬送される磁気カード2の一端部2bが検知機構5によって検知された時点を基準として、規定のプリアンブルのビット数に補正値nを加えたビット数のプリアンブルが記録されるように信号を生成する。この信号に基づいて磁気カード2への記録がなされる。   Next, the magnetic data recording process in step 52 will be described. In the magnetic data recording step, first, an operator inserts the magnetic card 2 on which no magnetic data is recorded into the magnetic card processing device 1. When the magnetic card 2 is inserted into the magnetic card processing device 1, the main CPU 21 transports the magnetic card 2 by the transport mechanism 4 and generates a recording signal. The recording signal is amplified by the amplifier circuit 24 and applied to the write head 32 in the magnetic head 3. Thereby, magnetic data is recorded on the magnetic card 2. At this time, the main CPU 21 uses the correction value n stored in the nonvolatile memory 23 so that the position of the start code recorded on the magnetic card 2 falls within a predetermined standard range. Specifically, the main CPU 21 sets the correction value to the specified number of bits of the preamble based on the time point when the detection mechanism 5 detects the one end 2b of the magnetic card 2 conveyed toward the magnetic head 3 by the conveyance mechanism 4. A signal is generated so that a preamble having the number of bits plus n is recorded. Recording on the magnetic card 2 is performed based on this signal.

磁気カード2に磁気データが記録されると、磁気カード処理装置1から磁気カード2が排出されて、磁気データ記録工程が終了する。なお、磁気ヘッド3に向かって搬送される磁気カード2の一端部2bが検知機構5によって検知された後、一端部2bが磁気ヘッド3の書き込みヘッド32のギャップに到達するまでに出力されたプリアンブルは、実際には磁気カード2に記録されない。また、磁気データ記録工程で磁気カード2に磁気データが記録された後、磁気カード処理装置1から磁気カード2を排出することなく、そのまま、始め符号位置確認工程を実行するようにしてもよい。その場合には、以下で説明する始め符号位置確認工程において、磁気データ記録工程で磁気データが記録された磁気カード2を磁気カード処理装置1に挿入する処理を行なう必要がない。   When magnetic data is recorded on the magnetic card 2, the magnetic card 2 is ejected from the magnetic card processing apparatus 1, and the magnetic data recording process is completed. The preamble output until the one end 2b reaches the gap of the write head 32 of the magnetic head 3 after the one end 2b of the magnetic card 2 conveyed toward the magnetic head 3 is detected by the detection mechanism 5. Is not actually recorded on the magnetic card 2. Alternatively, after the magnetic data is recorded on the magnetic card 2 in the magnetic data recording process, the code position confirmation process may be executed as it is without ejecting the magnetic card 2 from the magnetic card processing device 1. In that case, it is not necessary to perform a process of inserting the magnetic card 2 on which the magnetic data is recorded in the magnetic data recording process into the magnetic card processing apparatus 1 in the first code position confirmation process described below.

始め符号位置確認工程では、磁気データ記録工程で磁気データが記録された磁気カード2を作業員が磁気カード処理装置1に挿入する。磁気カード2が磁気カード処理装置1に挿入されると、制御回路20内のメインCPU21は、磁気カード2を搬送機構4によって搬送するとともに、サブCPU34に対し、磁気カード2に記録された磁気データを読み取ることを指令する。サブCPU34は、読み出しヘッド31により基準カードから読み出された信号を処理するが、始め符号を検出したときは、その旨をメインCPU21に通知する。この通知を受けてメインCPU21は、読み取られた磁気カード2の磁気データの始め符号の位置が所定の規格の範囲内に入っているのか否かを確認する。   In the first code position confirmation step, the operator inserts the magnetic card 2 on which the magnetic data is recorded in the magnetic data recording step into the magnetic card processing device 1. When the magnetic card 2 is inserted into the magnetic card processing device 1, the main CPU 21 in the control circuit 20 transports the magnetic card 2 by the transport mechanism 4 and also records the magnetic data recorded on the magnetic card 2 to the sub CPU 34. Command to read. The sub CPU 34 processes the signal read from the reference card by the read head 31, but when the code is detected at the beginning, the sub CPU 34 notifies the main CPU 21 to that effect. Upon receiving this notification, the main CPU 21 confirms whether or not the position of the start code of the read magnetic data of the magnetic card 2 is within a predetermined standard range.

具体的には、図6に示すように、メインCPU21は、ステップ111において、磁気カード2の一端部2bが検知機構5で検知された時刻、すなわち図3(a)に示す状態になった時刻t11をRAM22に記憶し、ステップ112において、サブCPU34からの通知に基づき、磁気カード2に記録された磁気データの始め符号が磁気ヘッド3の読み出しヘッド31のギャップに到達した時刻、すなわち図3(b)に示す状態になった時刻t12をRAM22に記憶する。その後、メインCPU21は、ステップ113において、RAM22に記憶されている時刻t11と時刻t12とに基づいて、磁気カード2の一端部2bが検知機構5で検知されたのち、磁気カード2に記録された始め符号が磁気ヘッド3に到達するまでの時間である測定時間t10=t12−t11を算出する。 Specifically, as shown in FIG. 6, the main CPU 21 determines in step 111 the time when the one end 2b of the magnetic card 2 is detected by the detection mechanism 5, that is, the time when the state shown in FIG. t 11 is stored in the RAM 22. In step 112, the time when the start code of the magnetic data recorded on the magnetic card 2 reaches the gap of the read head 31 of the magnetic head 3 based on the notification from the sub CPU 34, that is, FIG. The time t 12 at which the state shown in (b) is reached is stored in the RAM 22. Thereafter, the main CPU21 at step 113, based on the time t 11 and time t 12 which is stored in the RAM 22, after the one end portion 2b of the magnetic card 2 is detected by the detection mechanism 5, recorded in the magnetic card 2 A measurement time t 10 = t 12 −t 11 , which is a time until the start code reaches the magnetic head 3, is calculated.

メインCPU21は、ステップ114において、今回の測定時間t10と不揮発性メモリ23に記憶されている基準時間t0との差Δt=t10−t0を算出し、ステップ115において、基準カード2での始め符号の位置と、磁気データ記録工程で記録がなされた磁気カード2での始め符号の位置とのずれ量Y=Δt×Vを算出する。始め符号の位置は、具体的には、磁気ストライプ2aにおける始め符号の記録開始位置である。そしてメインCPU21は、ステップ116において、基準カードにおける一端部2bと始め符号の記録開始位置との距離Lと、ステップ115で算出されたずれ量Yとに基づいて、磁気データ記録工程で磁気データが記録された磁気カード2について、その一端部2bと磁気データの始め符号の記録開始位置との距離P=L+Yを算出する。基準カードは規格に基づいて始め符号が記録された磁気カード2であるから、距離Lは規格による値であるといえる。距離Pが算出されると、磁気カード2に記録された磁気データの始め符号の位置確認を行っている作業員は、算出された距離PがJIS規格やISO規格等の所定の規格の範囲内に入っているのか否かを確認する。これにより、始め符号位置確認工程が終了する、距離Pが所定の規格の範囲内に入ってるかどうかの判定は、メインCPU21自体が行なってもよい。このように本実施形態において始め符号位置確認工程では、基準カードに対して求められた基準時間t0と測定対象の磁気カード2に関して測定された測定時間t10との差Δtに基づいて距離Pを算出し、磁気カード2での磁気データの始め符号の位置が所定の規格の範囲内に入っているのか否かが確認される。 In step 114, the main CPU 21 calculates a difference Δt = t 10 −t 0 between the current measurement time t 10 and the reference time t 0 stored in the nonvolatile memory 23, and in step 115, the reference card 2 A deviation amount Y = Δt × V between the position of the start code and the position of the start code on the magnetic card 2 recorded in the magnetic data recording step is calculated. Specifically, the start code position is the start code recording start position in the magnetic stripe 2a. In step 116, the main CPU 21 determines that the magnetic data is stored in the magnetic data recording process based on the distance L between the one end 2b of the reference card and the recording start position of the start code and the shift amount Y calculated in step 115. For the recorded magnetic card 2, the distance P = L + Y between the one end 2b and the recording start position of the start code of the magnetic data is calculated. Since the reference card is the magnetic card 2 on which a code is recorded based on the standard, it can be said that the distance L is a value according to the standard. When the distance P is calculated, the worker who confirms the position of the start code of the magnetic data recorded on the magnetic card 2 is within the range of a predetermined standard such as the JIS standard or the ISO standard. Check if it is in. Thus, the main CPU 21 itself may determine whether or not the distance P is within the range of the predetermined standard at the beginning of the code position confirmation process. As described above, in the first code position confirmation step in this embodiment, the distance P is based on the difference Δt between the reference time t 0 obtained for the reference card and the measurement time t 10 measured for the magnetic card 2 to be measured. Is calculated, and it is confirmed whether or not the position of the start code of the magnetic data in the magnetic card 2 is within a predetermined standard range.

(始め符号の検出方法)
ところで、上述した始め符号の位置確認方法は、補正値算出工程および始め符号位置確認工程において、基準カードや磁気カード2の一端部2bが検知機構5で検知された時刻と始め符号が検出された時刻とをメインCPU21が正確に取得できることに依存している。メインCPU21自体が搬送機構4を制御し、検知機構5からの検知出力を受け取っているので、メインCPU21は前者の時刻を正確に知ることができる。しかしながら本実施形態では読み取りに関する処理を実行するサブCPU34を磁気ヘッド3に設け、メインCPU21とサブCPU34との間はシリアル通信用の通信路12によって接続しているので、通信線12を介したUART形式などでのデータ交換では、メインCPU21は、始め符号の検出を適時に知ることができず、その結果、始め符号が検出された時刻を正確には取得することができないことになる。そこで本実施形態では、始め符号の検出を行なうときだけ、サブCPU34からメインCPU21に向かうシリアル通信用の通信路を、二値信号を伝送する汎用入出力の通信路として使用する。汎用入出力の通信路であれば、シリアル通信に用いるコマンドのデータフォーマットなどに依存せずに、その通信路のレベルをロー(Low)とハイ(High)との間で切り替えることによって、サブCPU34からメインCPU21に対し、始め符号の検出を即座に伝えることができる。ここでレベルがローである信号とハイである信号とは、それぞれ、二値信号におけるレベルで表される第1の信号と第2の信号とに対応する。メインCPU21では、汎用入出力でのレベル変化によって割り込み処理が発生するなどのように構成しておけば、始め符号の検出時刻を正確に取得することができるようになる。以下の説明では、ローである信号が第1の信号に対応し、ハイである信号が第2の信号に対応するものとするが、ハイである信号が第1の信号に対応し、ローである信号が第2の信号に対応するように回路を設定してもよい。
(Initial code detection method)
By the way, according to the above-described start code position check method, the time and the start code at which the end part 2b of the reference card or the magnetic card 2 is detected by the detection mechanism 5 are detected in the correction value calculation process and the start code position check process. It depends on the fact that the main CPU 21 can accurately acquire the time. Since the main CPU 21 controls the transport mechanism 4 and receives the detection output from the detection mechanism 5, the main CPU 21 can accurately know the former time. However, in this embodiment, the magnetic head 3 is provided with a sub CPU 34 that executes processing related to reading, and the main CPU 21 and the sub CPU 34 are connected by the communication path 12 for serial communication. In the data exchange in the format or the like, the main CPU 21 cannot know the detection of the initial code in a timely manner, and as a result, cannot accurately acquire the time when the initial code is detected. Therefore, in the present embodiment, only when the code is detected first, the serial communication channel from the sub CPU 34 to the main CPU 21 is used as a general-purpose input / output communication channel for transmitting binary signals. In the case of a general-purpose input / output communication path, the sub CPU 34 is switched by switching the level of the communication path between low and high without depending on the data format of the command used for serial communication. Thus, the detection of the first code can be immediately transmitted to the main CPU 21. Here, the signal having a low level and the signal having a high level respectively correspond to a first signal and a second signal that are represented by levels in the binary signal. If the main CPU 21 is configured such that an interrupt process occurs due to a level change in the general-purpose input / output, the detection time of the first code can be accurately acquired. In the following description, a signal that is low corresponds to the first signal and a signal that is high corresponds to the second signal, but a signal that is high corresponds to the first signal and is low. The circuit may be set so that a certain signal corresponds to the second signal.

図7は、メインCPU21とサブCPU34との関係を示す回路図であり、(a)は通常の動作時、(b)は始め符号の検出を行なうときを示している。図7は、図2に対応する回路図であるが、始め符号の検出に関するメインCPU21とサブCPU34との間の通信に関係ない要素は記載していない。   7A and 7B are circuit diagrams showing the relationship between the main CPU 21 and the sub CPU 34. FIG. 7A shows a normal operation, and FIG. 7B shows a case where a code is first detected. FIG. 7 is a circuit diagram corresponding to FIG. 2, but does not describe elements that are not related to communication between the main CPU 21 and the sub CPU 34 regarding detection of the initial code.

メインCPU21やサブCPU34に用いるCPUは、一般に組み込み用あるいはコントローラ用として知られる種類のCPUであり、いくつかの入力ポートおよび出力ポートを備えている。入力と出力との両方に使用可能な入出力ポートを備える場合もある。そして、UART、SPI、I2Cなどのシリアル通信フォーマットのいずれかにしたがって入出力を行なうシリアル通信モードとシリアル通信フォーマットに依存せずに入出力を行なう汎用入力/汎用出力モードとのいずれかを各ポートに設定可能であり、レジスタ書き込みによってソフトウェア実行中にポートごとにそのモードを切り替えることができるようになっていることが一般的である。ポートを汎用出力ポートとして用いる場合、そのポートの出力値は、CPUにおける特定のインストラクションの実行によって、あるいは特定のレジスタの特定のビットに“0”あるいは“1”を書き込むことよって設定できる。ポートを汎用入力ポートとして用いる場合、単純にそのポートの値を読み出すだけではなく、そのポートへの入力値の変化によって割り込み処理を行なわせることができることもある。 The CPU used for the main CPU 21 and the sub CPU 34 is a type of CPU generally known as a built-in or controller, and has several input ports and output ports. There may be an input / output port that can be used for both input and output. Then, either a serial communication mode for inputting / outputting according to any of the serial communication formats such as UART, SPI, I 2 C, or a general-purpose input / output mode for inputting / outputting independent of the serial communication format is selected. Generally, each port can be set, and the mode can be switched for each port during software execution by register writing. When a port is used as a general-purpose output port, the output value of the port can be set by executing a specific instruction in the CPU or by writing “0” or “1” to a specific bit of a specific register. When a port is used as a general-purpose input port, it may be possible not only to read the value of the port but also to perform interrupt processing by changing the input value to the port.

本実施形態では、通常の動作時には、図7(a)に示すように、サブCPU34との通信に用いられるメインCPU21の1対の出力ポートおよび入力ポートは、それぞれUART Tx(送信)モードとUART Rx(受信)モードに設定され、メインCPU21との通信に用いられるサブCPU34の入力ポートと出力ポートは、それぞれURAT RxモードとUART Txモードに設定される。UARTモードは、シリアル通信モードの一種である。そして、メインCPU21とサブCPU34との間は、シリアル形式のコマンドデータによって通信が行われる。なお、ここではUART用の通信線としているので、各通信線は、受信側においてプルアップされている。サブCPU34に始め符号の検出を行わせるときは、図7(b)に示すように、サブCPU34の出力ポートをUART Txモードから汎用出力モードに切り替え、メインCPU21の入力ポートをUART Rxモードから汎用入力モードに切り替える。   In the present embodiment, during normal operation, as shown in FIG. 7A, the pair of output ports and input ports of the main CPU 21 used for communication with the sub CPU 34 are UART Tx (transmission) mode and UART, respectively. The input port and the output port of the sub CPU 34 that are set to the Rx (reception) mode and used for communication with the main CPU 21 are set to the URAT Rx mode and the UART Tx mode, respectively. The UART mode is a kind of serial communication mode. The main CPU 21 and the sub CPU 34 communicate with each other by serial command data. Since the communication line for UART is used here, each communication line is pulled up on the receiving side. When the sub CPU 34 first detects a code, as shown in FIG. 7B, the output port of the sub CPU 34 is switched from the UART Tx mode to the general-purpose output mode, and the input port of the main CPU 21 is switched from the UART Rx mode to the general-purpose output mode. Switch to input mode.

図8は、メインCPU21によってサブCPU34に始め信号(SS)の検出の処理を行なわせるときのメインCPU21およびサブCPU34の処理を示すシーケンス図である。初期状態では、メインCPU21およびサブCPU34の間での通信に使用されるポートはUARTモードとなっている。メインCPU21は、まずステップ201において、サブCPU34に対し始め符号検出指示のコマンドを通信路12を介して送信し、ステップ202において、自身の入力ポートをUART Rxモードから汎用入力モードに切り替える。サブCPU34は、始め符号検出指示のコマンドを受信すると、ステップ203において、始め符号を検出するモードに移行し、ステップ204において、自身の出力ポートをUART Txモードから汎用出力モードに切り替える。通信線のプルアップにより出力ポートはハイ状態となっているから、サブCPU34は、ステップ205において、汎用出力モードである出力ポートをローにしてメインCPU21に対して始め符号検出の準備が完了したことを通知し、ステップ209において、始め符号の検出を待ち受ける。   FIG. 8 is a sequence diagram showing processing of the main CPU 21 and the sub CPU 34 when the main CPU 21 causes the sub CPU 34 to perform processing for detecting the start signal (SS). In the initial state, the port used for communication between the main CPU 21 and the sub CPU 34 is in the UART mode. First, in step 201, the main CPU 21 transmits a code detection instruction command to the sub CPU 34 via the communication path 12. In step 202, the main CPU 21 switches its input port from the UART Rx mode to the general-purpose input mode. When the sub-CPU 34 receives the first code detection instruction command, in step 203, the sub CPU 34 shifts to a mode for detecting the first code. In step 204, the sub CPU 34 switches its output port from the UART Tx mode to the general-purpose output mode. Since the output port is in the high state due to the pull-up of the communication line, the sub CPU 34 sets the output port which is the general-purpose output mode to low in step 205, and the preparation for code detection is completed for the main CPU 21 first. In step 209, the process waits for detection of the first code.

メインCPU21は、ステップ202において入力ポートを汎用入力モードに切り替えたのち、ステップ206において、この汎用入力モードの入力ポートがローになるまで待ち受ける。ステップ205においてサブCPU34が汎用出力モードの出力ポートをローにすると、このことによってメインCPU21の入力ポートがローとなるから、メインCPU21は、ステップ207において、搬送機構4により磁気カード2を順方向に走行させる。そしてメインCPU21は、ステップ208において、磁気カード2に一端部2bが透過式センサである検知機構5によって検出された時刻を記録する。ステップ208の処理は、図5に示す処理でのステップ101、図6に示す処理でのステップ111に相当する。   After switching the input port to the general-purpose input mode in step 202, the main CPU 21 waits until the input port in the general-purpose input mode becomes low in step 206. When the sub CPU 34 sets the output port in the general-purpose output mode to low in step 205, this causes the input port of the main CPU 21 to go low. In step 207, the main CPU 21 moves the magnetic card 2 in the forward direction by the transport mechanism 4. Let it run. In step 208, the main CPU 21 records the time detected by the detection mechanism 5 whose one end portion 2 b is a transmission type sensor on the magnetic card 2. The process of step 208 corresponds to step 101 in the process shown in FIG. 5 and step 111 in the process shown in FIG.

このとき、サブCPU34では、既に始め符号の検出を待ち受ける状態(ステップ209)となっている。ここで読み出しヘッド31からの出力によってサブCPU34が始め符号を検出すると、サブCPU34は、ステップ210において、汎用出力モードであるその出力ポートをハイにし、その後、ステップ213において、出力ポートを汎用出力モードからUART Txモードに戻す。サブCPU34の出力ポートがハイになったことは、メインCPU21では、汎用入力モードであるその入力ポートにおいて検知され、メインCPU21は、ステップ211において、汎用入力モードである入力ポートがハイとなった時刻を記録し、ステップ212において、その入力ポートを汎用入力モードからUART Rxモードに戻す。   At this time, the sub CPU 34 is already in a state of waiting for detection of a code (step 209). When the sub CPU 34 first detects a code by the output from the read head 31, the sub CPU 34 sets its output port, which is the general output mode, to high in step 210, and then sets the output port to the general output mode in step 213. To return to UART Tx mode. The fact that the output port of the sub CPU 34 becomes high is detected in the main CPU 21 at the input port that is in the general-purpose input mode, and the main CPU 21 detects the time when the input port that is in the general-purpose input mode becomes high in step 211. In step 212, the input port is returned from the general-purpose input mode to the UART Rx mode.

メインCPU21でのステップ212の実行とサブCPU34でのステップ213の実行とにより、メインCPU21およびサブCPU34の入力ポートおよび出力ポートは、いずれも初期状態と同じUARTモードとなっており、メインCPU21とサブCPU34との間での双方向でのシリアル通信が可能な状態となっている。そこでメインCPU21は、ステップ214において、サブCPU34に対し、サブCPU34において始め符号の検出に成功したかどうかを問い合わせるコマンドを送信し、サブCPU34は、このコマンドを受信したら、ステップ215において、メインCPU21に対し、始め符号を正常に検出したことの通知か、あるいは、始め符号の正常な検出に失敗したことを示すエラー通知を送信する。以上により、始め符号の検出についての一連の処理が終了する。ステップ215において正常通知がなされた場合には、メインCPU21は、図5に示す処理でのステップ102あるいは図6に示す処理でのステップ112を実行する。一方、ステップ215でエラーが通知された場合には、メインCPU21は、図5に示す処理でのステップ102以降、あるいは図6に示す処理でのステップ112以降を実施しないようにする。   By executing step 212 in the main CPU 21 and executing step 213 in the sub CPU 34, the input port and the output port of the main CPU 21 and the sub CPU 34 are both in the same UART mode as in the initial state. Bidirectional serial communication with the CPU 34 is possible. In step 214, the main CPU 21 transmits a command to the sub CPU 34 asking whether the sub CPU 34 has succeeded in detecting the code. When the sub CPU 34 receives the command, the main CPU 21 sends the command to the main CPU 21 in step 215. On the other hand, a notification that the initial code has been detected normally or an error notification that indicates that the initial code has failed to be detected normally is transmitted. Thus, a series of processes for detecting the initial code is completed. When a normal notification is made in step 215, the main CPU 21 executes step 102 in the process shown in FIG. 5 or step 112 in the process shown in FIG. On the other hand, when an error is notified in step 215, the main CPU 21 does not perform step 102 and subsequent steps in the process shown in FIG. 5 or step 112 and subsequent steps in the process shown in FIG.

上述の処理において、サブCPU34が始め符号を検出しないといつまでもステップ209の待ち受け状態から抜け出せないことになる。そこで、ステップ209での待ち受け処理に対して所定のタイムアウト時間を設定し、タイムアウト時間が経過したら、始め符号の検出の有無に関わらず、サブCPU34の汎用出力モードである出力ポートをハイにし(ステップ210)、その後、サブCPU34の出力ポートを汎用出力モードからUART Txモードに戻すようにしてもよい(ステップ213)。その場合、ステップ214での問合せに対してサブCPU34はステップ215においてエラー通知を行なう。あるいは、ステップ201での始め符号検出指示コマンドの送信時から、またはステップ205での汎用出力モードの出力ポートをローにしたときから、メインCPU21とサブCPU34の両方でタイマー計時を開始し、タイマー値が所定値になった時点で始め符号の検出の有無に関わらず、メインCPU21がステップ212を実行し、サブCPU34がステップ213を実行するようにしてもよい。   In the above-described processing, if the sub CPU 34 does not detect the code at the beginning, it will not be possible to get out of the standby state of step 209 indefinitely. Therefore, a predetermined time-out time is set for the standby processing in step 209, and when the time-out time elapses, the output port which is the general-purpose output mode of the sub CPU 34 is set to high regardless of whether or not the code is detected at the beginning (step 210) Thereafter, the output port of the sub CPU 34 may be returned from the general-purpose output mode to the UART Tx mode (step 213). In that case, the sub CPU 34 issues an error notification in step 215 in response to the inquiry in step 214. Alternatively, the timer count is started by both the main CPU 21 and the sub CPU 34 after the start code detection instruction command is transmitted in step 201 or when the output port of the general-purpose output mode in step 205 is set to low. The main CPU 21 may execute step 212 and the sub CPU 34 may execute step 213 regardless of whether or not a code is detected at the time when becomes a predetermined value.

(実施形態の効果)
以上説明した実施形態によれば、磁気カード処理装置1が読み取り処理を実行するサブCPU34と全体の制御を行うメインCPU21とを備える場合に、メインCPUの側において磁気データの始め符号の検出時刻を正確に取得できるようになり、その結果、始め符号の位置の確認のために、磁気カード2を磁気現像し磁気現像された磁気データの始め符号の位置を顕微鏡を用いて目視で確認する必要がなくなる。したがって、磁気データ記録工程において磁気カード2に記録された磁気データでの始め符号の位置が所定の規格の範囲内に入っているのか否かを容易に確認することが可能になる。また、顕微鏡による目視での確認が不要となるので、磁気カード処理装置1を何らかの機器の内部に組み込んだ後であっても、その場で、基準カード2および磁気データが記録されていない磁気カード2を用いて、補正値nを算出して不揮発性メモリ23に記憶するとともに、磁気データの始め符号の記録開始タイミングが適切に補正されているのか否かを確認することが可能になる。さらに、補正値算出工程で算出された補正値nによって磁気データの始め符号の記録開始タイミングが適切に補正できているか否かを確認することも可能になる。
(Effect of embodiment)
According to the embodiment described above, when the magnetic card processing device 1 includes the sub CPU 34 that executes the reading process and the main CPU 21 that performs overall control, the detection time of the start code of the magnetic data is set on the main CPU side. As a result, in order to confirm the position of the initial code, it is necessary to magnetically develop the magnetic card 2 and visually confirm the position of the initial code of the magnetically developed magnetic data using a microscope. Disappear. Therefore, it is possible to easily confirm whether or not the position of the start code in the magnetic data recorded on the magnetic card 2 in the magnetic data recording process is within a predetermined standard range. In addition, since visual confirmation with a microscope is not necessary, even after the magnetic card processing apparatus 1 is incorporated in some device, the reference card 2 and the magnetic card on which no magnetic data is recorded are recorded on the spot. 2, the correction value n is calculated and stored in the nonvolatile memory 23, and it is possible to confirm whether or not the recording start timing of the start code of the magnetic data is appropriately corrected. Further, it is possible to confirm whether or not the recording start timing of the start code of the magnetic data can be appropriately corrected by the correction value n calculated in the correction value calculating step.

特に本実施形態では、従来は人手で行なっていた始め符号位置の調整・確認を、作業者が2回カード(基準カードおよび磁気カード)を挿入するのみで完了させることができるので、工数を削減できるとともにミスの発生の危険性を減らし、かつ、顕微鏡などの機材も削減できる。さらに、本実施形態に基づく始め符号の位置確認方法および始め符号の検出方法は、メインCPU21およびサブCPU34の動作を制御するソフトウェアあるいはファームウェアの書き換えを行なうだけで実行することができる。したがって本実施形態に基づく方法は、磁気ストライプに対する記録位置の補正をソフトウェアによって行っている機器であれば、カードリーダに限られることなく、また、出荷前であるか既設であるかに関わらず、任意に適用することができる。また実施形態に基づく方法は、シリアル通信による通信路しか用意されていないが、一時的に非常に厳密なタイミングの同期を取りたい場合にも応用できる。また、割り込みによって低消費電力状態から通常の消費電力状態に遷移することができるCPUをターゲットとして、シリアル通信線によって接続されている別のCPUからターゲットのCPUを起動させるような場合にも本実施形態の方法を適用できる。   In particular, in this embodiment, adjustment and confirmation of the initial code position, which has been performed manually by the operator, can be completed simply by inserting the card (reference card and magnetic card) twice by the operator, thereby reducing man-hours. In addition to reducing the risk of mistakes, equipment such as microscopes can also be reduced. Furthermore, the start code position confirmation method and the start code detection method based on the present embodiment can be executed only by rewriting software or firmware for controlling the operations of the main CPU 21 and the sub CPU 34. Therefore, the method according to the present embodiment is not limited to a card reader as long as it is a device that corrects the recording position with respect to the magnetic stripe by software, and whether it is before shipment or existing, It can be applied arbitrarily. In addition, the method based on the embodiment provides only a serial communication path, but can also be applied to a case where it is desired to temporarily synchronize the timing very strictly. This implementation is also performed when the target CPU is started from another CPU connected by a serial communication line, targeting a CPU that can transition from a low power consumption state to a normal power consumption state by an interrupt. The method of form can be applied.

(他の実施の形態)
上述した実施形態は、本発明の好適な実施形態の一例ではあるが、本発明はこれに限定されるものではない。本発明の要旨を変更しない範囲において種々の実施形態が可能である。
(Other embodiments)
The above-described embodiment is an example of a preferred embodiment of the present invention, but the present invention is not limited to this. Various embodiments are possible without departing from the scope of the present invention.

上述した実施形態では、不揮発性メモリ23に基準時間t0が記憶されているが、搬送機構4によって磁気ヘッド3に向かって搬送される基準カードの一端部2bが検知機構5で検知された後、基準カードに記録された磁気データの始め符号が磁気ヘッド3に到達するまでの搬送機構4による基準カードの送り量である基準送り量が、基準時間t0に代えて不揮発性メモリ23に記憶されていてもよい。その場合には、例えば、搬送ローラ7が連結されるモータ9にエンコーダを設け、搬送機構4によって磁気ヘッド3に向かって搬送される基準カードの一端部2bが検知機構5で検知されたのち、基準カードに記録された磁気データの始め符号が磁気ヘッド3に到達するまでにエンコーダから出力されたエンコーダパルスのパルス数を基準送り量とすればよい。あるいは、このエンコーダパルスのパルス数に基づいて基準送り量が算出される。 In the embodiment described above, the reference time t 0 is stored in the non-volatile memory 23, but after the detection mechanism 5 detects the one end 2 b of the reference card conveyed toward the magnetic head 3 by the conveyance mechanism 4. The reference feed amount which is the feed amount of the reference card by the transport mechanism 4 until the start code of the magnetic data recorded on the reference card reaches the magnetic head 3 is stored in the nonvolatile memory 23 instead of the reference time t 0. May be. In that case, for example, an encoder is provided in the motor 9 to which the transport roller 7 is connected, and after the one end 2b of the reference card transported toward the magnetic head 3 by the transport mechanism 4 is detected by the detection mechanism 5, The number of encoder pulses output from the encoder until the start code of the magnetic data recorded on the reference card reaches the magnetic head 3 may be used as the reference feed amount. Alternatively, the reference feed amount is calculated based on the number of encoder pulses.

基準時間の代わりに基準送り量を用いる場合には、補正値算出工程のステップ101〜103において、基準送り量を算出し、ステップ104〜106において、基準送り量に基づいて補正値nを算出し、ステップ107において、基準送り量および補正値nを不揮発性メモリ23に記憶する。そして、始め符号位置確認工程のステップ111〜113において、搬送機構4によって磁気ヘッド3に向かって搬送される磁気カード2の一端部2bが検知機構5で検知された後、磁気カード2に記録された磁気データの始め符号が磁気ヘッド3に到達するまでの搬送機構4による送り量である測定送り量を算出する。測定送り量は、例えば、搬送機構4によって磁気ヘッド3に向かって搬送される磁気カード2の一端部2bが検知機構5で検知された後、磁気カード2に記録された磁気データの始め符号が磁気ヘッド3に到達するまでに、エンコーダから出力されたエンコーダパルスのパルス数である。あるいは、測定送り量は、このエンコーダパルスのパルス数に基づいて算出される。始め符号位置確認工程では、基準送り量と測定送り量との差に基づいて、磁気データが読み取られた磁気カード2の磁気データの始め符号の位置が所定の規格の範囲内に入っているのか否かを確認する。   When the reference feed amount is used instead of the reference time, the reference feed amount is calculated in steps 101 to 103 of the correction value calculation step, and the correction value n is calculated based on the reference feed amount in steps 104 to 106. In step 107, the reference feed amount and the correction value n are stored in the nonvolatile memory 23. Then, in steps 111 to 113 of the first code position confirmation step, one end 2b of the magnetic card 2 conveyed toward the magnetic head 3 by the conveyance mechanism 4 is detected by the detection mechanism 5, and then recorded on the magnetic card 2. Then, a measured feed amount that is a feed amount by the transport mechanism 4 until the start code of the magnetic data reaches the magnetic head 3 is calculated. The measured feed amount is, for example, the start code of the magnetic data recorded on the magnetic card 2 after the detecting mechanism 5 detects the one end 2b of the magnetic card 2 conveyed toward the magnetic head 3 by the conveying mechanism 4. This is the number of encoder pulses output from the encoder before reaching the magnetic head 3. Alternatively, the measured feed amount is calculated based on the number of encoder pulses. In the start code position confirmation step, based on the difference between the reference feed amount and the measured feed amount, whether the start code position of the magnetic data of the magnetic card 2 from which the magnetic data has been read is within a predetermined standard range Confirm whether or not.

また、上述した実施形態において、基準時間t0に代えて、基準時間t0または基準送り量に基づいて算出される基準値が不揮発性メモリ23に記憶されていてもよい。この場合の基準値は、例えば、基準時間t0と磁気カード2の搬送速度Vとの積(t0×V)である。この場合、補正値算出工程において、基準値(基準時間t0と磁気カード2の搬送速度Vとの積)に基づいて補正値nを算出し、基準値および補正値nを不揮発性メモリ23に記憶する。始め符号位置確認工程においては、測定時間t10または測定送り量に基づく測定値を算出する。測定値は、例えば、測定時間t10とカード2の搬送速度Vとの積(t10×V)である。始め符号位置確認工程では、基準値と測定値との差に基づいて、磁気データが読み取られた磁気カード2の磁気データの始め符号の位置が所定の規格の範囲内に入っているのか否かを確認する。 Further, in the embodiment described above, instead of the reference time t 0, a reference value calculated based on the reference time t 0 or reference feeding amount may be stored in the nonvolatile memory 23. The reference value in this case is, for example, the product (t 0 × V) of the reference time t 0 and the conveyance speed V of the magnetic card 2. In this case, in the correction value calculation step, the correction value n is calculated based on the reference value (the product of the reference time t 0 and the conveyance speed V of the magnetic card 2), and the reference value and the correction value n are stored in the nonvolatile memory 23. Remember. In the beginning code location confirmation process, and it calculates the measured value based on the measured time t 10 or measured feed distance. The measured value is, for example, the product (t 10 × V) of the measurement time t 10 and the conveyance speed V of the card 2. In the start code position confirmation step, based on the difference between the reference value and the measured value, whether the position of the start code of the magnetic data of the magnetic card 2 from which the magnetic data has been read is within a predetermined standard range. Confirm.

上述した実施形態において、補正値算出工程に代えて、基準時間t0=t2−t1を算出して、基準時間t0を不揮発性メモリ23に記憶する工程が設けられていてもよい。この場合であっても、磁気データ記録工程において磁気カード2に記録された磁気データの始め符号の位置が所定の規格の範囲内に入っているのか否かを容易に確認することが可能になる。この場合には、磁気データ記録工程が実行されなくてもよい。磁気データ記録工程が実行されない場合には、始め符号位置確認工程において、予め磁気データが記録された磁気カード2を搬送機構4によって搬送する。この場合であっても、予め磁気データが記録された磁気カード2の磁気データの始め符号の位置が所定の規格の範囲内に入っているのか否かを容易に確認することが可能になる。 In the embodiment described above, instead of the correction value calculating step, a step of calculating the reference time t 0 = t 2 −t 1 and storing the reference time t 0 in the nonvolatile memory 23 may be provided. Even in this case, it is possible to easily confirm whether or not the position of the start code of the magnetic data recorded on the magnetic card 2 in the magnetic data recording process is within a predetermined standard range. . In this case, the magnetic data recording process may not be executed. When the magnetic data recording process is not executed, the magnetic card 2 on which the magnetic data is recorded in advance is transported by the transport mechanism 4 in the code position confirmation process. Even in this case, it is possible to easily confirm whether or not the position of the start code of the magnetic data of the magnetic card 2 in which the magnetic data is recorded in advance is within a predetermined standard range.

上述した実施形態において、基準カードに記録された磁気データの始め符号の位置と、磁気データ記録工程で磁気データが記録された磁気カード2の磁気データの始め符号の位置とのずれ量Yが所定の範囲内に入っているのか否かによって、磁気データが読み取られたカード2の磁気データの始め符号の位置が所定の規格の範囲内に入っているのか否かを確認してもよい。また、基準時間t0と測定時間t10との差Δtが所定の範囲内に入っているのか否かによって、磁気データが読み取られたカード2の磁気データの始め符号の位置が所定の規格の範囲内に入っているのか否かを確認してもよい。 In the above-described embodiment, the deviation amount Y between the position of the start code of the magnetic data recorded on the reference card and the position of the start code of the magnetic data of the magnetic card 2 on which the magnetic data is recorded in the magnetic data recording step is predetermined. Whether or not the position of the start code of the magnetic data of the card 2 from which the magnetic data has been read is within the range of a predetermined standard may be confirmed depending on whether or not it is within the range. Further, depending on whether or not the difference Δt between the reference time t 0 and the measurement time t 10 is within a predetermined range, the position of the start code of the magnetic data of the card 2 from which the magnetic data has been read is of a predetermined standard. You may check whether it is within the range.

上述した実施形態において、メインCPU21とサブCPU34との間でシリアル通信を行うときは、各ポートをシリアル通信モードの1種であるUARTモードとしている。しかしながらシリアル通信モードとして使用可能なものはUARTモードに限定されるものではなく、例えば、SPIモードあるいはI2Cモードを用いてもよい。 In the embodiment described above, when serial communication is performed between the main CPU 21 and the sub CPU 34, each port is set to a UART mode, which is one type of serial communication mode. However, what can be used as the serial communication mode is not limited to the UART mode, and for example, the SPI mode or the I 2 C mode may be used.

1 磁気カード処理装置
2 磁気カード
3 磁気ヘッド
4 搬送機構
5 検知機構
12 通信線
14 不揮発性メモリ
21 メインCPU
31 読み出しヘッド
34 サブCPU
DESCRIPTION OF SYMBOLS 1 Magnetic card processing apparatus 2 Magnetic card 3 Magnetic head 4 Conveyance mechanism 5 Detection mechanism 12 Communication line 14 Non-volatile memory 21 Main CPU
31 Read head 34 Sub CPU

Claims (10)

磁気カードに記録された磁気データを読み取って処理を行なう磁気カード処理装置であって、
前記磁気カードに記録された前記磁気データを読み取る磁気ヘッドと、
前記磁気カードを搬送する搬送機構と、
前記搬送機構により搬送された前記磁気カードの先端部を検知する検知機構と、
前記検知機構が接続されて前記搬送機構を制御し、前記磁気データにおける始め符号の位置を確認する第1の制御ユニットと、
前記磁気ヘッドに接続されるか前記磁気ヘッドに設けられて前記磁気ヘッドによって読み取られる磁気データについての処理を実行する第2の制御ユニットと、
前記第1の制御ユニットと前記第2の制御ユニットとをシリアル通信で接続するために用いられる通信路と、
を有し、
前記第1の制御ユニットは、前記通信路に接続してシリアル通信モードと汎用入力モードとの間で切り替え可能な入力ポートを有し、
前記第2の制御ユニットは、前記通信路に接続して前記シリアル通信モードと汎用出力モードとの間で切り替え可能な出力ポートを有し、
前記始め符号の位置の確認のために前記始め符号を検出するときに、前記第2の制御ユニットの前記出力ポートを前記汎用出力モードとし、前記第1の制御ユニットの前記入力ポートを前記汎用入力モードとする、磁気カード処理装置。
A magnetic card processing device for reading and processing magnetic data recorded on a magnetic card,
A magnetic head for reading the magnetic data recorded on the magnetic card;
A transport mechanism for transporting the magnetic card;
A detection mechanism for detecting a leading end portion of the magnetic card conveyed by the conveyance mechanism;
A first control unit connected to the detection mechanism to control the transport mechanism and confirm a position of a start code in the magnetic data;
A second control unit that performs processing on magnetic data that is connected to the magnetic head or provided on the magnetic head and read by the magnetic head;
A communication path used for connecting the first control unit and the second control unit by serial communication;
Have
The first control unit has an input port that can be switched between a serial communication mode and a general-purpose input mode by connecting to the communication path;
The second control unit has an output port that is switchable between the serial communication mode and the general-purpose output mode by connecting to the communication path,
When detecting the start code for confirming the position of the start code, the output port of the second control unit is set to the general-purpose output mode, and the input port of the first control unit is set to the general-purpose input. A magnetic card processing device as a mode.
前記始め符号を検出するときに、前記第1の制御ユニットは、前記通信路を介して前記第2の制御ユニットに対して前記始め符号検出指示のコマンドを送信して前記入力ポートを汎用入力モードに切り替え、
前記始め符号検出指示のコマンドを受信した前記第2の制御ユニットは、前記始め符号の検出を待ち受ける状態に移行するとともに、前記出力ポートを前記汎用出力モードに切り替えて前記出力ポートから第1の信号を出力し、
前記第1の制御ユニットは、前記第1の信号を前記入力ポートで受信すると、前記搬送機構によって前記磁気カードの搬送を開始し、前記検知機構が前記先端部を検知した時刻を記録する、請求項1に記載の磁気カード処理装置。
When detecting the start code, the first control unit transmits a command of the start code detection instruction to the second control unit via the communication path to set the input port to a general-purpose input mode. Switch to
The second control unit that has received the start code detection instruction command shifts to a state of waiting for the detection of the start code, and switches the output port to the general-purpose output mode to receive a first signal from the output port. Output
The first control unit, when receiving the first signal at the input port, starts transporting the magnetic card by the transport mechanism, and records the time when the detection mechanism detects the leading end. Item 2. The magnetic card processing device according to Item 1.
前記第2の制御ユニットは、前記始め符号を検出したら前記出力ポートから前記第1の信号とは異なる第2の信号を出力してそののち前記出力ポートを前記シリアル通信モードに切り替え、
前記第1の制御ユニットは、前記第2の信号を前記入力ポートで受信すると、前記第2の信号を受信した時刻を記録するとともに前記入力ポートを前記シリアル通信モードに切り替え、
前記出力ポートを前記シリアル通信モードに切り替えたのち、前記第2の制御ユニットは、前記始め符号の検出が正常に行なえたか否かを前記第1の制御ユニットに通知し、
前記始め符号の検出が正常に行なえたことを示す通知を受け取った場合に、前記第1の制御ユニットは、前記磁気カードへの前記磁気データの書き込みに際して前記始め符号を所定の規格の範囲内に書き込むために使用される補正値を算出して前記補正値をメモリに記録する、請求項2に記載の磁気カード処理装置。
The second control unit outputs a second signal different from the first signal from the output port when detecting the start code, and then switches the output port to the serial communication mode,
When the first control unit receives the second signal at the input port, it records the time when the second signal is received and switches the input port to the serial communication mode.
After switching the output port to the serial communication mode, the second control unit notifies the first control unit whether or not the detection of the initial code has been performed normally,
When receiving a notification indicating that the start code has been successfully detected, the first control unit sets the start code within a predetermined standard when writing the magnetic data to the magnetic card. The magnetic card processing device according to claim 2, wherein a correction value used for writing is calculated and the correction value is recorded in a memory.
前記第2の制御ユニットは、前記始め符号の検出の有無に関わらずタイムアウトの発生によって前記出力ポートから前記第2の信号を出力してそののち前記出力ポートを前記シリアル通信モードに切り替え、前記第1の制御ユニットに対し、前記始め符号の検出が正常に行なえなかったことを通知する、請求項3に記載の磁気カード処理装置。   The second control unit outputs the second signal from the output port when a timeout occurs regardless of whether or not the start code is detected, and then switches the output port to the serial communication mode. The magnetic card processing device according to claim 3, wherein the first control unit is notified that the start code cannot be normally detected. 前記始め符号検出指示のコマンドの送信後または前記第1の信号の出力後、所定の時間が経過したら、前記第1の制御ユニットは前記入力ポートを前記シリアル通信モードに切り替え、前記第2の制御ユニットは前記出力ポートを前記シリアル通信モードに切り替える、請求項2乃至4のいずれか1項に記載の磁気カード処理装置。   The first control unit switches the input port to the serial communication mode when the predetermined time has elapsed after the transmission of the start code detection instruction command or the output of the first signal, and the second control 5. The magnetic card processing device according to claim 2, wherein the unit switches the output port to the serial communication mode. 磁気カードに記録された磁気データを読み取る磁気ヘッドと、前記磁気カードを搬送する搬送機構と、前記搬送機構により搬送された前記磁気カードの先端部を検知する検知機構と、前記検知機構が接続されて前記搬送機構を制御し、前記磁気データにおける始め符号の位置を確認する第1の制御ユニットと、前記磁気ヘッドに接続されるか前記磁気ヘッドに設けられて前記磁気ヘッドによって読み取られる磁気データについての処理を実行する第2の制御ユニットと、前記第1の制御ユニットと前記第2の制御ユニットとをシリアル通信で接続するために用いられる通信路と、を有する磁気カード処理装置における、前記磁気データの始め符号の検出方法であって、
前記始め符号を検出するときに、前記第2の制御ユニットに設けられて前記通信路に接続する出力ポートをシリアル通信モードから汎用出力モードに切り替え、前記第1の制御ユニットに設けられて前記通信路に接続する入力ポートを前記シリアル通信モードから汎用入力モードに切り替える、始め符号の検出方法。
A magnetic head for reading magnetic data recorded on the magnetic card, a transport mechanism for transporting the magnetic card, a detection mechanism for detecting the leading end of the magnetic card transported by the transport mechanism, and the detection mechanism are connected. A first control unit that controls the transport mechanism and confirms a position of a start code in the magnetic data, and magnetic data that is connected to the magnetic head or provided on the magnetic head and read by the magnetic head In the magnetic card processing device, comprising: a second control unit that executes the above process; and a communication path that is used to connect the first control unit and the second control unit by serial communication. A method for detecting a start code of data,
When the start code is detected, an output port provided in the second control unit and connected to the communication path is switched from a serial communication mode to a general-purpose output mode, and provided in the first control unit for the communication. A method for detecting a start code, wherein an input port connected to a road is switched from the serial communication mode to a general-purpose input mode.
前記始め符号を検出するときに、前記第1の制御ユニットが、前記通信路を介して前記第2の制御ユニットに対して前記始め符号検出指示のコマンドを送信して前記入力ポートを汎用入力モードに切り替え、
前記始め符号検出指示のコマンドを受信したときに、前記第2の制御ユニットが、前記始め符号の検出を待ち受ける状態に移行するとともに、前記出力ポートを前記汎用出力モードに切り替えて前記出力ポートから第1の信号を出力し、
前記第1の信号を前記入力ポートで受信したときに、前記第1の制御ユニットが、前記搬送機構による前記磁気カードの搬送を開始させ、前記検知機構が前記先端部を検知した時刻を記録する、請求項6に記載の始め符号の検出方法。
When detecting the start code, the first control unit transmits a command of the start code detection instruction to the second control unit via the communication path to set the input port to the general-purpose input mode. Switch to
When receiving the start code detection instruction command, the second control unit shifts to a state of waiting for the detection of the start code, and switches the output port to the general-purpose output mode. 1 signal is output,
When the first signal is received at the input port, the first control unit starts transporting the magnetic card by the transport mechanism, and records the time when the detection mechanism detects the leading end. The method for detecting a start code according to claim 6.
前記始め符号を検出したときに、前記第2の制御ユニットが、前記出力ポートから前記第1の信号とは異なる第2の信号を出力してそののち前記出力ポートを前記シリアル通信モードに切り替え、
前記第2の信号を前記入力ポートで受信したときに、前記第1の制御ユニットが、前記第2の信号を受信した時刻を記録するとともに前記入力ポートを前記シリアル通信モードに切り替え、
前記出力ポートが前記シリアル通信モードに切り替わったのち、前記第2の制御ユニットが、前記始め符号の検出が正常に行なえたか否かを前記第1の制御ユニットに通知し、
前記始め符号の検出が正常に行なえたことを示す通知を受け取ったときに、前記第1の制御ユニットが、前記磁気カードへの前記磁気データの書き込みに際して前記始め符号を所定の規格の範囲内に書き込むために使用される補正値を算出して前記補正値をメモリに記録する、請求項7に記載の始め符号の検出方法。
When the start code is detected, the second control unit outputs a second signal different from the first signal from the output port, and then switches the output port to the serial communication mode,
When the second signal is received at the input port, the first control unit records the time when the second signal is received and switches the input port to the serial communication mode;
After the output port is switched to the serial communication mode, the second control unit notifies the first control unit whether or not the start code has been successfully detected.
When the first control unit receives a notification indicating that the start code has been successfully detected, the first control unit sets the start code within a predetermined standard when writing the magnetic data to the magnetic card. 8. The method of detecting a start code according to claim 7, wherein a correction value used for writing is calculated and the correction value is recorded in a memory.
前記始め符号を検出の有無に関わらず、タイムアウトの発生によって、前記第2の制御ユニットが、前記出力ポートから前記第2の信号を出力してそののち前記出力ポートを前記シリアル通信モードに切り替え、前記第1の制御ユニットに対し、前記始め符号の検出が正常に行なえなかったことを通知する、請求項8に記載の始め符号の検出方法。   Regardless of whether the start code is detected or not, when a timeout occurs, the second control unit outputs the second signal from the output port, and then switches the output port to the serial communication mode. The start code detection method according to claim 8, wherein the first control unit is notified that the start code cannot be normally detected. 前記始め符号検出指示のコマンドの送信後または前記第1の信号の出力後、所定の時間が経過したら、前記第1の制御ユニットが前記入力ポートを前記シリアル通信モードに切り替え、前記第2の制御ユニットが前記出力ポートを前記シリアル通信モードに切り替える、請求項7乃至9のいずれか1項に記載の始め符号の検出方法。   The first control unit switches the input port to the serial communication mode when the predetermined time has elapsed after the transmission of the start code detection instruction command or the output of the first signal, and the second control The method for detecting a start code according to any one of claims 7 to 9, wherein the unit switches the output port to the serial communication mode.
JP2018062028A 2018-03-28 2018-03-28 Magnetic card processing device and method for detecting the start code of magnetic data Active JP7033476B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018062028A JP7033476B2 (en) 2018-03-28 2018-03-28 Magnetic card processing device and method for detecting the start code of magnetic data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018062028A JP7033476B2 (en) 2018-03-28 2018-03-28 Magnetic card processing device and method for detecting the start code of magnetic data

Publications (2)

Publication Number Publication Date
JP2019175526A true JP2019175526A (en) 2019-10-10
JP7033476B2 JP7033476B2 (en) 2022-03-10

Family

ID=68167095

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018062028A Active JP7033476B2 (en) 2018-03-28 2018-03-28 Magnetic card processing device and method for detecting the start code of magnetic data

Country Status (1)

Country Link
JP (1) JP7033476B2 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09274572A (en) * 1996-04-08 1997-10-21 Toshiba Eng Co Ltd Card interruption processing method and processor for the same
JPH09312001A (en) * 1996-05-21 1997-12-02 Tokin Corp Method for inspecting magnetic recording card
JP2000339873A (en) * 1999-05-27 2000-12-08 Oki Electric Ind Co Ltd Checking method for propriety of read-data of magnetic stripe, read-device for medium with magnetic stripe, and printer using this read-device
JP2002230912A (en) * 2001-01-29 2002-08-16 Nec Access Technica Ltd System for reading magnetic stripe and handy terminal
JP2010086126A (en) * 2008-09-30 2010-04-15 Nidec Sankyo Corp Magnetic card reader

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09274572A (en) * 1996-04-08 1997-10-21 Toshiba Eng Co Ltd Card interruption processing method and processor for the same
JPH09312001A (en) * 1996-05-21 1997-12-02 Tokin Corp Method for inspecting magnetic recording card
JP2000339873A (en) * 1999-05-27 2000-12-08 Oki Electric Ind Co Ltd Checking method for propriety of read-data of magnetic stripe, read-device for medium with magnetic stripe, and printer using this read-device
JP2002230912A (en) * 2001-01-29 2002-08-16 Nec Access Technica Ltd System for reading magnetic stripe and handy terminal
JP2010086126A (en) * 2008-09-30 2010-04-15 Nidec Sankyo Corp Magnetic card reader

Also Published As

Publication number Publication date
JP7033476B2 (en) 2022-03-10

Similar Documents

Publication Publication Date Title
JP4618286B2 (en) Label paper double feed detection device
JP4799050B2 (en) Printing device
US9147137B2 (en) Label printer, and method of searching optimal communication position
JP2005149013A (en) Check processor, host computer for check processor and check processing method
JP7009242B2 (en) Data writer
EP2264709A1 (en) Card reader and processing method thereof
JP4845528B2 (en) RFID reading system, RFID reading method, control device, and computer program
JP7033476B2 (en) Magnetic card processing device and method for detecting the start code of magnetic data
JP2006293461A (en) Ic tag processor and ic tag processing method
JP5425846B2 (en) Writing device and program
JP4518766B2 (en) Card processing device
KR102657382B1 (en) Device and method for detecting skew of medium
JP6155722B2 (en) Image forming system, writing apparatus, and control program
JP2019101522A (en) Card reader control method and card reader
EP1331597B1 (en) Magnetic stripe processing apparatus and printer
JP2014059782A (en) Write device and image forming device
JP5624332B2 (en) Magnetic information reader and method for controlling magnetic information reader
JP2008114375A (en) Printer and its control method
JP4507625B2 (en) Single-sheet paper reading device, composite processing device, and single-sheet paper reading processing method
JP3745020B2 (en) Character image recognition printing communication device
JP4316440B2 (en) Single sheet processing device
JP2022121037A (en) Card reader and magnetic data demodulation method
JP2018097902A (en) Magnetic recording apparatus and magnetic recording method
JP2001143022A (en) Ic card issuing device
JPH05178500A (en) Medium conveyance control system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210305

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220114

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20220208

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220228

R150 Certificate of patent or registration of utility model

Ref document number: 7033476

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150