Rockwell Automation FactoryTalk Historian Classic for Batch User Guide User Manual
Page 34

Chapter 3 Collecting Batch Data
FROM bhbatchhis
WHERE recordno = '5817'
--PRINT 'Total length of column: '
--PRINT '------'
--PRINT @maxval
--PRINT ''
-- Last chunk, reduce buffer size to the nChars
remaining
IF (@offsetval + @bufferval) > @maxval
BEGIN
SELECT @bufferval = @maxval - @offsetval
--PRINT 'Last chuck... buffer size
remaining is: '
--PRINT '------'
--PRINT @bufferval
END
WHILE @offsetval < @maxval
BEGIN
READTEXT bhbatchhis.InstructionHTML
@txtptrval @offsetval
@bufferval
--PRINT 'Data started at character
position'
--PRINT @offsetval
SELECT @offsetval = @offsetval +
@bufferval
--PRINT 'Data ended at character position'
--PRINT @offsetval
--PRINT ' '
-- Last chunk, reduce buffer size
to the get the last nChars remaining
IF (@offsetval +
@bufferval) > @maxval
SELECT
@bufferval = @maxval - @offsetval + 1
END
SET NOCOUNT OFF
END
4. In the query, edit the WHERE clause to specify the recordno
for which you want to view the InstructionHTML.
5. Run the query and save the results to a file name, such as
Output.html.
34
Rockwell Automation Publication BHIST-UM011A-EN-E-June 2014