JP7033476B2 - Magnetic card processing device and method for detecting the start code of magnetic data - Google Patents

Magnetic card processing device and method for detecting the start code of magnetic data Download PDF

Info

Publication number
JP7033476B2
JP7033476B2 JP2018062028A JP2018062028A JP7033476B2 JP 7033476 B2 JP7033476 B2 JP 7033476B2 JP 2018062028 A JP2018062028 A JP 2018062028A JP 2018062028 A JP2018062028 A JP 2018062028A JP 7033476 B2 JP7033476 B2 JP 7033476B2
Authority
JP
Japan
Prior art keywords
control unit
magnetic
start code
magnetic card
code
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.)
Active
Application number
JP2018062028A
Other languages
Japanese (ja)
Other versions
JP2019175526A (en
Inventor
史彦 二村
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

Images

Landscapes

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

Description

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

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

特開2005-44453号公報Japanese Unexamined Patent Publication No. 2005-44453

特許文献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 when the code is first detected when the standard card is read must be known accurately, and is magnetically operated by a single control unit (for example, a CPU (Central Processing Unit)). It is premised that data reading, data writing, and card transfer in the card processing device are controlled. However, in recent years, for the purpose of improving security, a sub CPU that executes reading processing is provided inside the magnetic head, and the signal read from the magnetic card is processed by the sub CPU, for example, encryption processing, and this processing is performed. Magnetic card processing devices that are configured to send data to the main CPU are becoming widespread. In such a magnetic card processing device, a UART (Universal Asynchronous Receiver /) is used between the main CPU that performs overall control of the magnetic card processing device, particularly data writing and card transfer control, and the sub CPU in the magnetic head. It is connected by a communication path that performs serial communication in the form of Transmitter), SPI (Serial Peripheral Interface), I 2C , etc., and data and commands are exchanged between both CPUs in a command format. However, since the data is exchanged in the command format by the communication path of serial communication, there is a delay in notifying the main CPU that the start code is detected in the sub CPU, and the start code is detected with the main CPU. It becomes difficult to synchronize with the sub CPU. As a result, it becomes difficult to accurately determine the time difference T. It is conceivable to provide a separate communication line only for notifying the detection timing of the start code, but 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) for performing overall control and a second control unit (for example, a sub CPU) for executing a reading process, wherein the starting reference code is used. It is an object of the present invention to provide a magnetic card processing device capable of accurately detecting the starting code for confirming the position of the magnetic card processing unit, and a method for detecting the starting code in the magnetic card processing device.

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

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

本発明では、始め符号を検出するときに、第1の制御ユニットが、通信路を介して第2の制御ユニットに対して始め符号検出指示のコマンドを送信して入力ポートを汎用入力モードに切り替え、始め符号検出指示のコマンドを受信した第2の制御ユニットが、始め符号の検出を待ち受ける状態に移行するとともに、出力ポートを汎用出力モードに切り替えて出力ポートから第1の信号を出力し、第1の信号を入力ポートで受信した第1の制御ユニットが、搬送機構によって磁気カードの搬送を開始し、検知機構が検知した時刻を記録するようにすることが好ましい。第1の信号としては、例えば、二値信号における一方のレベルの信号を用いられる。これにより、始め符号を検出するタイミングにあわせて、制御ユニット間の通信路を始め符号の検出専用に切り替えることができる。 In the present invention, when the start code is detected, the first control unit sends a command for starting code detection instruction 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 received the command of the start code detection instruction shifts to the state of waiting for the detection of the start code, switches the output port to the general-purpose output mode, outputs the first signal from the output port, and is the first. It is preferable that the first control unit that has received the signal of 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 to the dedicated code detection only at the timing of detecting the starting code.

本発明では、出力ポートから第1の信号を出力したのち始め符号を検出したときに、第2の制御ユニットが、出力ポートから第1の信号とは異なる第2の信号を出力してそののち出力ポートをシリアル通信モードに切り替え、第2の信号を入力ポートで受信した第1の制御ユニットが、第2の信号を受信した時刻を記録するとともに入力ポートをシリアル通信モードに切り替え、出力ポートをシリアル通信モードに切り替えた第2の制御ユニットが、始め符号の検出が正常に行なえたか否かを第1の制御ユニットに通知し、始め符号の検出が正常に行なえたことを示す通知を受け取った場合に、第1の制御ユニットが、磁気カードへの磁気データの書き込みに際して始め符号を所定の規格の範囲内に書き込むために使用される補正値を算出して補正値をメモリに記録することが好ましい。第2の信号は、例えば、二値信号における、第1の信号とは異なるレベルの信号である。これにより、始め符号を検出した時刻を第1の制御ユニットが遅延なく正確に記録できるようになる。 In the present invention, when the first signal is output from the output port and then the start code is detected, 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 first control unit that receives the second signal at the input port records the time when the second signal is received, switches the input port to the serial communication mode, and switches the output port. The second control unit switched to the serial communication mode notified the first control unit whether or not the start code was detected normally, and received a notification indicating that the start code was detected normally. In this case, the first control unit may calculate the correction value used to write the code within the range of a predetermined standard at the beginning of writing the magnetic data to the magnetic card, and record the correction value in the memory. preferable. The second signal is, for example, a signal in a binary signal having a level different from that of the first 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 a second signal from its output port due to the occurrence of a timeout regardless of the presence or absence of detection of the starting code, and then switches the output port to the serial communication mode to obtain the starting code. It is preferable to notify the first control unit that the detection could not be performed normally. As a result, even if the code cannot be detected at the beginning in the second control unit, the serial communication between the control units can be restored.

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

全体の制御を行う第1の制御ユニットと読み取り処理を実行する第2の制御ユニットとを備える磁気カード処理装置であっても、制御ユニット間の通信での遅延や同期の影響を回避して、始め符号の位置の確認のために始め符号を正確に検出できるようになる。 Even a magnetic card processing device including a first control unit that performs overall control and a second control unit that executes reading processing can avoid the effects of delays and synchronization in communication between control units. The start code can be detected accurately to confirm the position of the start 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) and (b) are plan views explaining the operation of the magnetic card processing apparatus shown in FIG. 始め符号の位置確認方法を示すフローチャートである。It is a flowchart which shows the position confirmation method of a start code. 補正値算出工程を説明するフローチャートである。It is a flowchart explaining the correction value calculation process. 始め符号位置確認工程を説明するフローチャートである。It is a flowchart explaining the process of confirming a code point at the beginning. (a),(b)は、通信路の切り替えを説明する図である。(A) and (b) are diagrams for explaining the switching of communication paths. 始め符号の検出の処理を示すシーケンス図である。It is a sequence diagram which shows the process of the detection of a start code.

次に、本発明を実施するための形態について、図面を参照して説明する。 Next, a mode 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が設けられている。
(Rough 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), is connected to a host computer or the like, and writes and reads data to and from the magnetic card 2 according to the instruction of the host computer. Is. The host computer is, for example, 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 conveys the magnetic card 2, and an end of the card 2. It is provided with a detection mechanism 5 for detecting a unit. The transfer mechanism 4 includes a transfer roller 7 connected to the motor 9 and a pad roller 8 arranged to face the transfer roller 7 and urged toward the transfer roller 7. The magnetic card 2 is conveyed in a state of being sandwiched between the transfer 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 for controlling 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 the electrical circuit configuration of the magnetic card processing device 1. The control circuit 20 includes a main CPU 21 that executes overall control of the magnetic card processing device 1, in particular, control of writing to the magnetic card 2 and transfer control, a RAM (random access memory) 22 connected to the main CPU 21, and a control circuit 20. It includes a non-volatile 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 for detecting 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 integrates 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. It also includes an amplification circuit 33 that amplifies the detected signal. 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 encryption processing on the converted digital signal on the spot, so that the input terminal A / D can be used. It is equipped with. A signal detected by the read head 31 and amplified by the amplifier circuit 33 is input to the input terminals A / D. The sub CPU 34 may be provided outside the magnetic head 3 and connected to the magnetic head 3 as long as it can process the signal from the read head 31, but if the sub CPU 34 performs encryption processing or the like, it may be connected to the magnetic head 3. It is preferable that it 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 according to a command from the main CPU 21, and notifies the main CPU 21 of a processing result or the like. Therefore, the input / output unit I / O for the interface of the main CPU 21 and the input / output unit I / O for the interface of the sub CPU 34 are connected by a communication path 12 composed of 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 JIS standards and ISO standards, 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 2a on which magnetic data is recorded is formed along the longitudinal direction of the magnetic card 2. The magnetic card 2 may have a built-in IC chip or may have a built-in antenna for data communication. 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) Consists of characters and post-amble elements, which are recorded on the magnetic stripe 2a in this order from one end 2b to the other end 2c of the magnetic card 2 in the longitudinal direction. Has been done. As described above, the JIS standard and the ISO standard define the position of the start code of the magnetic data with respect to one end 2b.

図3は、磁気カード処理装置1の動作を説明する平面図である。磁気カード処理装置1において磁気カード2は、その搬送方向(図1および図3での左右方向)とその長手方向とが一致するように、搬送機構4によって搬送される。磁気カード2に記録された磁気データが磁気ヘッド3で読み取られるとき、および、磁気ヘッド3によって磁気カード2に磁気データが記録されるときには、一端部2bが最初に磁気ヘッド3に接触するように、磁気カード2が搬送される。ここで示す例では、一端部2bは、磁気ヘッド3に向かって搬送される磁気カード2の先端部となっている。以降において、この方向に磁気カード2が搬送される方向を順方向とする。 FIG. 3 is a plan view illustrating the operation of the magnetic card processing device 1. In the magnetic card processing device 1, the magnetic card 2 is conveyed by the conveying mechanism 4 so that its conveying direction (left-right direction in FIGS. 1 and 3) and its longitudinal direction coincide with each other. 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, one end portion 2b first contacts the magnetic head 3. , The magnetic card 2 is conveyed. In the example shown here, the one end portion 2b is the tip end portion of the magnetic card 2 conveyed toward the magnetic head 3. Hereinafter, the direction in which the magnetic card 2 is conveyed in this direction is defined 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 transport path of the magnetic card 2. The detection mechanism 5 is a magnetic card in which when the magnetic data recorded on the magnetic card 2 is read by the magnetic head 3, the recorded start code is conveyed toward the magnetic head 3 before reaching the magnetic head 3. Detects one end 2b of 2. Specifically, the detection mechanism 5 detects one end 2b 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 shown by a thick line in FIG. 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 transport direction of the magnetic card 2, but are actually shown by broken lines in FIG. 3 (a). As described above, due to the design of the magnetic card reader 1, the gap between 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 reading head 31 is arranged at the same position in the transport direction of the magnetic card 2. It is supposed to be done. In terms of design, when magnetic data is recorded on the magnetic card 2, when one end 2b of the magnetic card 2 is detected by the detection mechanism 5, the magnetic head 3 records a preamble with a number of bits specified 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, due to the influence of the mounting error of the magnetic head 3 and the detection mechanism 5, 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 deviate in the transport direction of the magnetic card 2. For example, as shown by a solid line in FIGS. 1 and 3, the center of the detection mechanism 5 may be located upstream of the position of the gap between the read head 31 and the write head 32 in the transport direction of the magnetic card 2. If the position of the gap and the center of the detection mechanism 5 are deviated from each other in the transport direction of the magnetic card 2, the position of the start code in the magnetic data recorded on the magnetic card 2 is deviated. Specifically, the position of the starting code with respect to one end portion 2b shifts.

そこで、本実施形態の磁気カード処理装置1では、出荷前などに、磁気カード2に記録される磁気データの始め符号の位置ずれを抑制するための補正を行っている。また、本実施形態では、補正後に、磁気カード処理装置1によって磁気カード2に磁気データを記録するとともに、磁気カード2に記録された磁気データの始め符号の位置を検出し確認している。以下、補正値の算出工程を含む磁気データの始め符号の位置確認方法を説明する。 Therefore, in the magnetic card processing device 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 shipping. Further, in the present embodiment, after the correction, the 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 step of calculating the correction value will be described.

(始め符号の位置確認方法)
図4は、始め符号の位置確認方法を説明するフローチャートであり、図5は、補正値算出工程を示すフローチャートであり、図6は、始め符号位置確認工程を示すフローチャートである。図4に示すように、始め符号の位置確認方法では、ステップ51において補正値算出工程を実行し、次にステップ52において磁気データ記録工程を実行し、最後にステップ53において始め符号位置確認工程を実行する。
(How to check the position of the start code)
FIG. 4 is a flowchart illustrating a method of confirming the position of the starting code, FIG. 5 is a flowchart showing a correction value calculation process, and FIG. 6 is a flowchart showing a process of confirming the position of the starting code. As shown in FIG. 4, in the method of confirming the position of the starting code, the correction value calculation step is executed in step 51, then the magnetic data recording step is executed in step 52, and finally the starting code position confirmation step is performed 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 step of step 51, a reference card, which is a 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, the worker first inserts the reference card into the magnetic card processing device 1. When the reference card is inserted, the main CPU 21 in the control circuit 20 commands the sub CPU 34 in the magnetic head 3 to read the magnetic data recorded on the reference card while transporting the reference card by the transport mechanism 4. .. The sub CPU 34 processes the signal read from the reference card by the read head 31, and when the start code is detected, the sub CPU 34 notifies the main CPU 21 to that effect. Then, the main CPU 21 is 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 one end 2b of the reference card to be conveyed is detected by the detection mechanism 5. 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, in step 101, the main CPU 21 reaches the time when 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. 3A is reached. 1 is stored in the RAM 22, and in step 102, 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. 3 (b), based on the notification from the sub CPU 34. ) Is stored in the RAM 22 at the time t 2 in which the state is shown. After that, in step 103, the main CPU 21 calculates the 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に記憶する。これにより補正値算出工程が終了する。 Let time T be the value (L / V) obtained by dividing the distance L between one end 2b of the reference card and the recording start position of the start code of the magnetic data by the transport speed V of the card 2 by the transport mechanism 4, and the time T is , It is a fixed value that can be calculated in advance. After step 103, the main CPU 21 calculates the time Δt 0 = t 0 −T in step 104. That is, the main CPU 21 calculates the time Δt 0 required for the reference card to be transported by the distance corresponding to the amount of deviation between the center of the detection mechanism 5 and the gap of the read head 31 of the magnetic head 3 in the transport direction of the reference card. .. Subsequently, the main CPU 21 calculates the amount of deviation 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. 3 (a). The main CPU 21 calculates the correction value n = X / A in step 106, where the interval between the preamble bits in the magnetic stripe 2a is A, and in step 107, the reference time t 0 and the correction value n are set to the non-volatile memory 23. Remember in. This completes the correction value calculation process.

次に、ステップ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 step of step 52 will be described. In the magnetic data recording step, the worker first inserts the magnetic card 2 on which the magnetic data is not 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 conveys the magnetic card 2 by the conveying 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. As a result, magnetic data is recorded on the magnetic card 2. At this time, the main CPU 21 uses the correction value n stored in the non-volatile memory 23 so that the position of the starting code recorded on the magnetic card 2 is within the range of a predetermined standard. Specifically, the main CPU 21 corrects the number of bits in the specified preamble based on the time when one end 2b of the magnetic card 2 conveyed toward the magnetic head 3 by the transfer mechanism 4 is detected by the detection mechanism 5. Generate a signal so that a preamble with the number of bits plus n is recorded. Recording is performed on the magnetic card 2 based on this signal.

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

始め符号位置確認工程では、磁気データ記録工程で磁気データが記録された磁気カード2を作業員が磁気カード処理装置1に挿入する。磁気カード2が磁気カード処理装置1に挿入されると、制御回路20内のメインCPU21は、磁気カード2を搬送機構4によって搬送するとともに、サブCPU34に対し、磁気カード2に記録された磁気データを読み取ることを指令する。サブCPU34は、読み出しヘッド31により基準カードから読み出された信号を処理するが、始め符号を検出したときは、その旨をメインCPU21に通知する。この通知を受けてメインCPU21は、読み取られた磁気カード2の磁気データの始め符号の位置が所定の規格の範囲内に入っているのか否かを確認する。 In the start code position confirmation step, the worker 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 conveys the magnetic card 2 by the transfer mechanism 4, and the magnetic data recorded in 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, and when the start code is detected, 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 the range of a predetermined standard.

具体的には、図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, in step 111, the main CPU 21 reaches the time when 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. 3A is reached. t 11 is stored in the RAM 22, and 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. After that, in step 113, the main CPU 21 detects one end 2b of the magnetic card 2 by the detection mechanism 5 based on the time t 11 and the time t 12 stored in the RAM 22, and then records it on the magnetic card 2. The measurement time t 10 = t 12 −t 11 , which is the time until the start code is reached at 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 the difference Δt = t 10 −t 0 between the current measurement time t 10 and the reference time t 0 stored in the non-volatile memory 23, and in step 115, the reference card 2 is used. The amount of deviation 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 position of the start code is the recording start position of the start code on the magnetic stripe 2a. Then, in step 116, the main CPU 21 generates magnetic data in the magnetic data recording step based on the distance L between one end 2b of the reference card and the recording start position of the start code and the deviation amount Y calculated in step 115. For the recorded magnetic card 2, the distance P = L + Y between 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 the code is first 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 beginning code of the magnetic data recorded on the magnetic card 2 has the calculated distance P within the range of a predetermined standard such as JIS standard or ISO standard. Check if it is in. As a result, the main CPU 21 itself may determine whether or not the distance P is within the range of the predetermined standard at which the code point confirmation step ends. As described above, in the code position confirmation step at the beginning of the present 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 on the magnetic card 2 is within the range of a predetermined standard.

(始め符号の検出方法)
ところで、上述した始め符号の位置確認方法は、補正値算出工程および始め符号位置確認工程において、基準カードや磁気カード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の信号に対応するように回路を設定してもよい。
(How to detect the start code)
By the way, in the above-mentioned method for confirming the position of the starting code, the time and the starting code detected by the detection mechanism 5 at one end 2b of the reference card or the magnetic card 2 are detected in the correction value calculation step and the starting code position confirmation step. It depends on the fact that the main CPU 21 can accurately acquire the time. Since the main CPU 21 itself 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 the present embodiment, the sub CPU 34 that executes the process related to reading is provided in the magnetic head 3, and the main CPU 21 and the sub CPU 34 are connected by the communication path 12 for serial communication. Therefore, the UART via the communication line 12 In data exchange in a format or the like, the main CPU 21 cannot know the detection of the start code in a timely manner, and as a result, cannot accurately acquire the time when the start code is detected. Therefore, in the present embodiment, the communication path for serial communication from the sub CPU 34 to the main CPU 21 is used as a general-purpose input / output communication path for transmitting binary signals only when the initial code is detected. If it is a general-purpose input / output communication path, the sub CPU 34 can be switched between low (Low) and high (High) by switching the level of the communication path between low (Low) and high (High) without depending on the data format of the command used for serial communication. Can immediately inform the main CPU 21 of the detection of the starting code. Here, the low level signal and the high level signal correspond to the first signal and the second signal represented by the level in the binary signal, respectively. If the main CPU 21 is configured such that interrupt processing is generated due to a level change in general-purpose input / output, the detection time of the start code can be accurately acquired. In the following description, it is assumed that the low signal corresponds to the first signal and the high signal corresponds to the second signal, but the high signal corresponds to the first signal and is low. The circuit may be configured such that one signal corresponds to a 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, where FIG. 7A shows normal operation and FIG. 7B shows the time when the start code is detected. FIG. 7 is a circuit diagram corresponding to FIG. 2, but does not describe elements not related to communication between the main CPU 21 and the sub CPU 34 regarding the detection of the starting 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 an embedded CPU or a controller, and has several input ports and output ports. It may have input / output ports that can be used for both inputs and outputs. Then, either a serial communication mode in which input / output is performed according to any of serial communication formats such as UART, SPI, and I 2C and a general-purpose input / general-purpose output mode in which input / output is performed independently of the serial communication format are selected. It can be set for each port, and it is common that the mode can be switched for each port during software execution by writing a register. When a port is used as a general purpose output port, the output value of that port can be set by executing a particular instruction in the CPU or by writing a "0" or "1" to a particular bit in a particular register. When a port is used as a general-purpose input port, it may be possible not only to simply 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 this 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 output port of the sub CPU 34 set to the Rx (receive) mode and used for communication with the main CPU 21 are set to the UART Rx mode and the UART Tx mode, respectively. The UART mode is a kind of serial communication mode. Then, communication is performed between the main CPU 21 and the sub CPU 34 by command data in serial format. Since the communication line for UART is used here, each communication line is pulled up on the receiving side. When the sub CPU 34 is made to detect the code at the beginning, 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 changed from the UART Rx mode to the general purpose. 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 the processing of the main CPU 21 and the sub CPU 34 when the main CPU 21 causes the sub CPU 34 to perform the processing of detecting the signal (SS) at the beginning. 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 first transmits a code detection instruction command to the sub CPU 34 via the communication path 12, and in step 202, the main CPU 21 switches its input port from the UART Rx mode to the general-purpose input mode. Upon receiving the command for instructing the start code, the sub CPU 34 shifts to the mode for detecting the start code in step 203, and switches its output port from the UART Tx mode to the general-purpose output mode in step 204. Since the output port is in the high state due to the pull-up of the communication line, in step 205, the sub CPU 34 sets the output port, which is the general-purpose output mode, to low, and the preparation for code detection is completed for the main CPU 21. Is notified, and in step 209, the detection of the starting code is awaited.

メインCPU21は、ステップ202において入力ポートを汎用入力モードに切り替えたのち、ステップ206において、この汎用入力モードの入力ポートがローになるまで待ち受ける。ステップ205においてサブCPU34が汎用出力モードの出力ポートをローにすると、このことによってメインCPU21の入力ポートがローとなるから、メインCPU21は、ステップ207において、搬送機構4により磁気カード2を順方向に走行させる。そしてメインCPU21は、ステップ208において、磁気カード2に一端部2bが透過式センサである検知機構5によって検出された時刻を記録する。ステップ208の処理は、図5に示す処理でのステップ101、図6に示す処理でのステップ111に相当する。 The main CPU 21 switches the input port to the general-purpose input mode in step 202, and then waits until the input port of this general-purpose input mode becomes low in step 206. When the sub CPU 34 sets the output port of the general-purpose output mode to low in step 205, the input port of the main CPU 21 becomes low, so that the main CPU 21 forwards the magnetic card 2 by the transport mechanism 4 in step 207. Let it run. Then, in step 208, the main CPU 21 records on the magnetic card 2 the time when one end 2b is detected by the detection mechanism 5 which is a transmissive sensor. 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 the detection of the code at the beginning (step 209). Here, when the sub CPU 34 detects the start code by the output from the read head 31, the sub CPU 34 sets its output port, which is the general-purpose output mode, to high in step 210, and then sets the output port to the general-purpose output mode in step 213. Return to UART Tx mode. The high output port of the sub CPU 34 is detected in the main CPU 21 at the input port which is the general-purpose input mode, and the main CPU 21 is the time when the input port which is the general-purpose input mode becomes high in step 211. And 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 the initial state, and the main CPU 21 and the sub CPU 21 are in the same UART mode. Bidirectional serial communication with the CPU 34 is possible. Therefore, in step 214, the main CPU 21 transmits a command to the sub CPU 34 asking whether or not the code was successfully detected at the beginning of the sub CPU 34, and when the sub CPU 34 receives this command, the sub CPU 34 sends the command to the main CPU 21 in step 215. On the other hand, a notification indicating that the start code is normally detected or an error notification indicating that the normal detection of the start code has failed is transmitted. As a result, a series of processes for detecting the starting code is completed. When the normal notification is given 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 or later in the process shown in FIG. 5 or step 112 or later 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 process, if the sub CPU 34 does not detect the code at the beginning, the standby state of step 209 cannot be exited forever. Therefore, a predetermined time-out time is set for the standby process 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 high regardless of whether or not the start code is detected (step). 210), and then 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 notifies an error in step 215 in response to the inquiry in step 214. Alternatively, timer timing is started on both the main CPU 21 and the sub CPU 34 from the time when 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, and the timer value is set. The main CPU 21 may execute step 212 and the sub CPU 34 may execute step 213 regardless of whether or not the code is detected at the beginning when the value reaches 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 controls the whole, 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 starting code, it is necessary to magnetically develop the magnetic card 2 and visually confirm the position of the starting code of the magnetically developed magnetic data using a microscope. It disappears. Therefore, in the magnetic data recording process, it is possible to easily confirm whether or not the position of the starting code in the magnetic data recorded on the magnetic card 2 is within the range of a predetermined standard. In addition, since it is not necessary to visually check with a microscope, the reference card 2 and the magnetic card on which magnetic data is not recorded are not recorded on the spot even after the magnetic card processing device 1 is incorporated in some device. Using No. 2, it is possible to calculate the correction value n and store it in the non-volatile memory 23, and to confirm whether or not the recording start timing of the start code of the magnetic data is appropriately corrected. Further, it is also 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 calculation step.

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

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

基準時間の代わりに基準送り量を用いる場合には、補正値算出工程のステップ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. , The reference feed amount and the correction value n are stored in the non-volatile memory 23 in step 107. Then, in steps 111 to 113 of the initial code position confirmation step, one end 2b of the magnetic card 2 conveyed toward the magnetic head 3 by the transfer mechanism 4 is detected by the detection mechanism 5, and then recorded on the magnetic card 2. The measured feed amount, which is the 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 detection mechanism 5 detects one end 2b of the magnetic card 2 conveyed toward the magnetic head 3 by the transfer 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 pulses of this encoder pulse. In the start code position confirmation step, is the position of the start code of the magnetic data of the magnetic data from which the magnetic data is read within the range of a predetermined standard based on the difference between the reference feed amount and the measurement feed amount? Check if it is 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 above-described embodiment, instead of the reference time t 0 , the reference value calculated based on the reference time t 0 or the reference feed amount may be stored in the non-volatile memory 23. The reference value in this case is, for example, the product (t 0 × V) of the reference time t 0 and the transport 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 transport speed V of the magnetic card 2), and the reference value and the correction value n are set in the non-volatile memory 23. Remember. In the start code point confirmation step, the measured value based on the measurement time t 10 or the measurement feed amount is calculated. The measured value is, for example, the product (t 10 × V) of the measurement time t 10 and the transport speed V of the card 2. In the start code position confirmation step, whether or not the position of the start code of the magnetic data of the magnetic data from which the magnetic data is read is within a predetermined standard range based on the difference between the reference value and the measured value. To confirm.

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

上述した実施形態において、基準カードに記録された磁気データの始め符号の位置と、磁気データ記録工程で磁気データが記録された磁気カード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 data recorded in the magnetic data recording step is predetermined. Depending on whether or not the magnetic data is within the range of, it may be confirmed whether or not the position of the start code of the magnetic data of the card 2 from which the magnetic data is read is within the range of a predetermined standard. 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 is read is of a predetermined standard. You may check whether it is within the range.

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

1 磁気カード処理装置
2 磁気カード
3 磁気ヘッド
4 搬送機構
5 検知機構
12 通信線
14 不揮発性メモリ
21 メインCPU
31 読み出しヘッド
34 サブCPU
1 Magnetic card processing device 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 that reads and processes magnetic data recorded on a magnetic card.
A magnetic head that reads the magnetic data recorded on the magnetic card, and
A transport mechanism for transporting the magnetic card and
A detection mechanism that detects the tip of the magnetic card conveyed by the transfer mechanism, and
A first control unit to which the detection mechanism is connected to control the transport mechanism and confirm the position of the starting code in the magnetic data, and
A second control unit connected to the magnetic head or provided on the magnetic head to perform processing on magnetic data read by the magnetic head.
A communication path used for connecting the first control unit and the second control unit by serial communication, and
Have,
The first control unit has an input port connected to the communication path and capable of switching between a serial communication mode and a general-purpose input mode.
The second control unit has an output port that is connected to the communication path and can be switched between the serial communication mode and the general-purpose output mode.
When the start code is detected to confirm 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. Magnetic card processing device in mode.
前記始め符号を検出するときに、前記第1の制御ユニットは、前記通信路を介して前記第2の制御ユニットに対して前記始め符号検出指示のコマンドを送信して前記入力ポートを汎用入力モードに切り替え、
前記始め符号検出指示のコマンドを受信した前記第2の制御ユニットは、前記始め符号の検出を待ち受ける状態に移行するとともに、前記出力ポートを前記汎用出力モードに切り替えて前記出力ポートから第1の信号を出力し、
前記第1の制御ユニットは、前記第1の信号を前記入力ポートで受信すると、前記搬送機構によって前記磁気カードの搬送を開始し、前記検知機構が前記先端部を検知した時刻を記録する、請求項1に記載の磁気カード処理装置。
When the start code is detected, the first control unit transmits the 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,
Upon receiving the command of the start code detection instruction, the second control unit shifts to a state of waiting for the detection of the start code, switches the output port to the general-purpose output mode, and receives the first signal from the output port. Is output,
Upon receiving the first signal 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 tip portion. Item 1. The magnetic card processing apparatus according to Item 1.
前記第2の制御ユニットは、前記始め符号を検出したら前記出力ポートから前記第1の信号とは異なる第2の信号を出力してそののち前記出力ポートを前記シリアル通信モードに切り替え、
前記第1の制御ユニットは、前記第2の信号を前記入力ポートで受信すると、前記第2の信号を受信した時刻を記録するとともに前記入力ポートを前記シリアル通信モードに切り替え、
前記出力ポートを前記シリアル通信モードに切り替えたのち、前記第2の制御ユニットは、前記始め符号の検出が正常に行なえたか否かを前記第1の制御ユニットに通知し、
前記始め符号の検出が正常に行なえたことを示す通知を受け取った場合に、前記第1の制御ユニットは、前記磁気カードへの前記磁気データの書き込みに際して前記始め符号を所定の規格の範囲内に書き込むために使用される補正値を算出して前記補正値をメモリに記録する、請求項2に記載の磁気カード処理装置。
When the second control unit detects the opening code, it 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 first control unit receives the second signal 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 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 start code was normally performed.
Upon receiving the notification indicating that the detection of the starting code was successful, the first control unit keeps the starting code within a predetermined standard when writing the magnetic data to the magnetic card. The magnetic card processing apparatus 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 due to the occurrence of a timeout regardless of the presence or absence of detection of the start code, and then switches the output port to the serial communication mode, and the second control unit. The magnetic card processing apparatus according to claim 3, which notifies the control unit of No. 1 that the detection of the starting code could not be performed normally. 前記始め符号検出指示のコマンドの送信後または前記第1の信号の出力後、所定の時間が経過したら、前記第1の制御ユニットは前記入力ポートを前記シリアル通信モードに切り替え、前記第2の制御ユニットは前記出力ポートを前記シリアル通信モードに切り替える、請求項2乃至4のいずれか1項に記載の磁気カード処理装置。 After a predetermined time has elapsed after the transmission of the command for detecting the start code or the output of the first signal, the first control unit switches the input port to the serial communication mode and controls the second. The magnetic card processing apparatus according to any one of claims 2 to 4, wherein the unit switches the output port to the serial communication mode. 磁気カードに記録された磁気データを読み取る磁気ヘッドと、前記磁気カードを搬送する搬送機構と、前記搬送機構により搬送された前記磁気カードの先端部を検知する検知機構と、前記検知機構が接続されて前記搬送機構を制御し、前記磁気データにおける始め符号の位置を確認する第1の制御ユニットと、前記磁気ヘッドに接続されるか前記磁気ヘッドに設けられて前記磁気ヘッドによって読み取られる磁気データについての処理を実行する第2の制御ユニットと、前記第1の制御ユニットと前記第2の制御ユニットとをシリアル通信で接続するために用いられる通信路と、を有する磁気カード処理装置における、前記磁気データの始め符号の検出方法であって、
前記始め符号を検出するときに、前記第2の制御ユニットに設けられて前記通信路に接続する出力ポートをシリアル通信モードから汎用出力モードに切り替え、前記第1の制御ユニットに設けられて前記通信路に接続する入力ポートを前記シリアル通信モードから汎用入力モードに切り替える、始め符号の検出方法。
A magnetic head that reads the magnetic data recorded on the magnetic card, a transport mechanism that transports the magnetic card, a detection mechanism that detects the tip of the magnetic card conveyed by the transport mechanism, and the detection mechanism are connected. The first control unit that controls the transport mechanism and confirms the position of the starting code in the magnetic data, and the magnetic data that is connected to the magnetic head or is provided on the magnetic head and read by the magnetic head. The magnetism in a magnetic card processing apparatus having a second control unit for executing the processing of the above, and a communication path used for connecting the first control unit and the second control unit by serial communication. It is a method of detecting the beginning code of data.
When the start code is detected, the output port provided in the second control unit and connected to the communication path is switched from the serial communication mode to the general-purpose output mode, and the first control unit is provided with the communication. A method of detecting a starting code, in which an input port connected to a road is switched from the serial communication mode to the general-purpose input mode.
前記始め符号を検出するときに、前記第1の制御ユニットが、前記通信路を介して前記第2の制御ユニットに対して前記始め符号検出指示のコマンドを送信して前記入力ポートを汎用入力モードに切り替え、
前記始め符号検出指示のコマンドを受信したときに、前記第2の制御ユニットが、前記始め符号の検出を待ち受ける状態に移行するとともに、前記出力ポートを前記汎用出力モードに切り替えて前記出力ポートから第1の信号を出力し、
前記第1の信号を前記入力ポートで受信したときに、前記第1の制御ユニットが、前記搬送機構による前記磁気カードの搬送を開始させ、前記検知機構が前記先端部を検知した時刻を記録する、請求項6に記載の始め符号の検出方法。
When the start code is detected, the first control unit sends 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 the command of the start code detection instruction is received, the second control unit shifts to the state of waiting for the detection of the start code, and at the same time, the output port is switched to the general-purpose output mode and the first from the output port. Output the signal of 1
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 tip portion. , 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 detection of the starting code can be performed normally.
Upon receiving the notification indicating that the detection of the starting code was successful, the first control unit keeps the starting code within a predetermined standard when writing the magnetic data to the magnetic card. The method for 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 or not the start code is detected, the second control unit outputs the second signal from the output port and then switches the output port to the serial communication mode due to the occurrence of a timeout. The method for detecting a start code according to claim 8, wherein the first control unit is notified that the detection of the start code could not be performed normally. 前記始め符号検出指示のコマンドの送信後または前記第1の信号の出力後、所定の時間が経過したら、前記第1の制御ユニットが前記入力ポートを前記シリアル通信モードに切り替え、前記第2の制御ユニットが前記出力ポートを前記シリアル通信モードに切り替える、請求項7乃至9のいずれか1項に記載の始め符号の検出方法。 After a predetermined time has elapsed after the transmission of the command for detecting the start code or the output of the first signal, the first control unit switches the input port to the serial communication mode, and the second control is performed. 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 JP2019175526A (en) 2019-10-10
JP7033476B2 true 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 (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2945865B2 (en) * 1996-04-08 1999-09-06 東芝エンジニアリング株式会社 Card interrupt processing device
JPH09312001A (en) * 1996-05-21 1997-12-02 Tokin Corp Method for inspecting magnetic recording card

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
JP2019175526A (en) 2019-10-10

Similar Documents

Publication Publication Date Title
JP4419527B2 (en) Host computer for check processing apparatus, check processing system, and check processing method
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
CN109840437B (en) Control method of card reader and card reader
JP6155722B2 (en) Image forming system, writing apparatus, and control program
JP2001184466A (en) Ic card reader
JP3745020B2 (en) Character image recognition printing communication device
JP2006313466A (en) Card image reading apparatus and its control method
JP5623992B2 (en) Information processing apparatus, information processing method, recording medium, and program
JP3739590B2 (en) Media reader
EP1331597B1 (en) Magnetic stripe processing apparatus and printer
JPH11213099A (en) Ic card handling device
JP2014059782A (en) Write device and image forming device
JP2007052853A (en) Card processor
JP3241393B2 (en) Information storage device and information protection method
JP2008114375A (en) Printer and its control method
JP2852854B2 (en) Card reader device
JP2022121037A (en) Card reader and magnetic data demodulation method
JP2011165234A (en) Magnetic information reading device and control method of magnetic information reading device
JP2001143022A (en) Ic card issuing device
JP2018097902A (en) Magnetic recording apparatus and magnetic recording method
JP2006252192A (en) Medium processor

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