View Full Version : virtual terminal API
01-01-1995, 02:00 AM
Thanks Bruce for your comments. I think your idea is the correct approach. I am nhowever having some issue. Help please..... Do you or anyone have sample RPG that incorporated virtual terminal API'S. I have tried using the API's as described in the IBM API manual, without much success. I am trying to establish a telnet session with an RS600 so that i can screen scrape. I have been able to use the QTVOPNVT to open a session, but when i try to read directly after, using QTVRDVT, I get CPF87f3 (buffer length invalid.). I have included a brief section of my code. What am I doing wrong? Is the concept correct?
11-20-2000, 08:32 AM
A couple of things: 1. You need to change vt#TOREAD and vtDATARECVD from 4B to 9B. This will get you past the error on Read. 2. Prior to calling QTVRDVT you really should check for a message on your *DTAQ indicating that there is data available to read. Right now you probably have one message for every successful Open that you have tested with. You should most likely make it a policy to clear this *DTAQ prior to each Open so as to avoid left over messages. 3. The call to QTVOPNVT is opening a virtual terminal session on your AS/400. What you will get back from QTVRDVT on your first call is most likely going to be the AS/400 Signon screen for the virtual session (alternatively you might get a 5250 Query order so that you can describe your device capabilities). You will need to signon to this session (within your application program) and then telnet from the virtual session. After you make the 4B to 9B change above, try an eval vtDATA after the QTVRDVT to see what you get. Note that you can bypass the signon screen with Optional Parameter Group 2 and keys 1 and 2. 4. The Address you are providing is not for where you want the session to be opened; it is so that system administrators can associate an address with who might be using the virtual terminal session. 5. So your first two assumptions are not correct, but your third one (use QTVWRTVT to do further processing/input) is correct.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.