Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

error with the "command=tablename&units=true" instruction


cristian24 Aug 16, 2021 10:53 AM

Hello,

I have a problem with the instruction "command=tablename&units=true". It should show me the units of the variables contained in a specific table, but it doesn't. I have a problem with the command "command=tablename&units=true". The code I am using is as follows:

--------------------------------------------------------------------------------------------------------------------------------------------

sequentialmode

Dim command As String * 300

Public Temp_CR6
Units Temp_CR6 = Grados


DataTable (Table1,True,-1) 

  DataInterval (0,1,Min,10) 

  Sample (1,Temp_CR6,FP2)

EndTable


WebPageBegin("default.html",command) 

 HTTPOut("<!DOCTYPE HTML PUBLIC " + CHR(34) + "-//W3C//DTD HTML 4.0 Transitional//EN" + CHR(34)+ ">")   HTTPOut("<HTML>")   

 HTTPOut("<HEAD>")   

   HTTPOut("<meta http-equiv=" + CHR(34) +"refresh"+ CHR(34) + "content="+ CHR(34) +"60"+ CHR(34)+ ">")   

   HTTPOut("<TITLE>CR6</TITLE>") 

 HTTPOut("</HEAD>") 

HTTPOut("<BODY>")      

 HTTPOut("<ul><li><a href="+ CHR(34) + "command=NewestRecord&table=Table1"+ CHR(34) + ">Newest Record from     Table1</a></li></ul>")     

 HTTPOut("<ul><li><a href=" + CHR(34) + "command=Table1&units=true" + CHR(34) + ">Unidades</a></li></ul>")   

 HTTPOut("</BODY>")  HTTPOut("</HTML>")

WebPageEnd


BeginProg   

  Scan (1,Sec,3,0)         

   PanelTemp (Temp_CR6,15000)   

   CallTable (Table1) 

  NextScan

EndProg

----------------------------------------------------------------------------------------------------------------------------------------------------


The instruction "command=NewestRecord&table=Table1" works correctly, it shows me the last record. But the instruction "command=Table1&units=true" does not show me the units. When I access the link it creates, I get the following message, and at the top I get the error 404.


"Unrecognized request"


Can someone please help me?


Nico Aug 24, 2021 08:54 AM

Where does "command=Table1&units=true" come from? What manual/guide?

If I were to guess and '&units=true' is a feature to show the latest record with units attached you might want to try this:

"command=NewestRecord&table=Table1&units=true"

But without a list of possible commands and how that API works it's a little futile to stab around in the dark..


cristian24 Aug 25, 2021 10:47 AM

Hello,
I am looking at the "CR6 CRBasic Help", in the section "WebPageBegin/WebPageEnd", in the final part that shows a table. 

But your help has helped me to solve the problem, thanks a lot!

Log in or register to post/reply in the forum.