IP_SendData????

J.Y.J.Y. Junior MemberPosts: 34
Dear all,

I have a ip-cam , can I use Netlinx send_string like "http://192.168.0.100/ptzf.cgi?action=up"; to let it up ?

Jason.
«1

Comments

  • shanemshanem Junior Member Posts: 28
    Jason,
    Try opening a port on the camera using the ip_client_open command. Once this port is open then you should be able to send comands to the camera using the 'GET' command from the HTTP protocol. e.g.

    send_string camera,"''GET ptzf.cgi?action=up HTTP/1.0',13,10,
    'Host: localhost',13,10,
    'Connection: Keep-Alive',13,10,
    'Cache-Control: no-cache',13,10,13,10"

    (where camera is the device no. i.e. 0:5:0)

    Shane
  • J.Y.J.Y. Junior Member Posts: 34
    Dear Shane,

    I open a IP_Client(port:80) session,
    and then
    send_string IP_Client,"'GET ptzf.cgi?visca=8101060105060302FF HTTP/1.1',13,10,'Host:192.168.0.152',13,10,'Connection: Keep-Alive',13,10,
    'Cache-Control: no-cache',13,10,13,10"
    But it can't work well.
    Am I type wrong?or .......

    thanks your help.
  • shanemshanem Junior Member Posts: 28
    To open a port for communication to a server(the camera) you must do the following:
    result = ip_client_open(camera.port,'192.168.0.152',80,1)
    where 80 is the port and 1 is the protocol, in this case TCP

    Try something along the lines of this,

    define_device
    camera = 0:10:0

    button_event[tp,upButton]
    {
    push:
    {
    sinteger result
    result = ip_client_open(camera.Port,'192.168.0.152',80,1)//80=port,1=TCP
    wait_until(camOnline) //set to 1 in online camera event, 0 in offline event
    {
    send_string camera,"''GET ptzf.cgi?action=up HTTP/1.0',13,10
    'Host: localhost',13,10,
    'Connection: Keep-Alive',13,10,
    'Cache-Control: no-cache',13,10,13,10"
    }
    }
    }

    Make sure to set the 'camOnline' variable to 1 in an online event for the camera and camOnline to 0 in an offline event.
    Also, the result variable will return an sinteger value. You should probably check to see this value returns 0 before sending the string to the camera. If it returns anything other than 0 that means there was an error opening the port.
  • Marc ScheibeinMarc Scheibein Junior Member Posts: 669
    J.Y. wrote:
    Dear Shane,

    I open a IP_Client(port:80) session,
    and then
    send_string IP_Client,"'GET ptzf.cgi?visca=8101060105060302FF HTTP/1.1',13,10,'Host:192.168.0.152',13,10,'Connection: Keep-Alive',13,10,
    'Cache-Control: no-cache',13,10,13,10"
    But it can't work well.
    Am I type wrong?or .......

    thanks your help.

    The visca string sound like a Sony SNC-PZ30 IP cam...
    Find attached an AWX ToGo workspace with a working example for pan and tilt functions. I also somewhere have an example for this cam with more functions, but I have to search for it.....

    Good luck!
  • damiendamien Junior Member Posts: 10
    Hello,

    I am currently busy with an AXIS 212 IP cam and would like to control the zoom pan tilt functions. I do not have many experience with ip control.
    Below my function to move the camera to the right,


    // http://192.168.0.150/axis-cgi/com/ptz.cgi?camera=1&move=right // panning right
    button_event[dvtp,1]
    {
    push:
    {
    if(!(cam_online))
    {
    ip_client_open(camera.Port,'192.168.0.150',80,1)//80=port,1=TCP
    }

    wait_until (cam_online)
    {
    send_string camera,"'GET ptz.cgi?camera=1&move=right http/1.1',13,10,13,10,'HOST: 192.168.0.202',13,10,13,10";
    }


    }
    }

    I found on the forums some information about opening and controlling ip clients but nothing
    seems to work. Any ideas ??
    Thanks
  • Marc ScheibeinMarc Scheibein Junior Member Posts: 669
    string may be
    send_string camera,"'GET axis-cgi/com/ptz.cgi?camera=1&move=right HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,13,10"
    
  • damiendamien Junior Member Posts: 10
    Doesn't seem to help,
    I have put in an online button to see wether camera is online or offline.
    If I place in the define start section: ip client open...
    He comes online, when I push the button to move camera right he goes offline and doesn't come online anymore ? When I remove ip client open in the define start section he doesn't come online at all ???
    Is there something I could test with the ip client open function ?

    Thanks
  • DHawthorneDHawthorne Junior Member Posts: 4,584
    damien wrote:
    Doesn't seem to help,
    I have put in an online button to see wether camera is online or offline.
    If I place in the define start section: ip client open...
    He comes online, when I push the button to move camera right he goes offline and doesn't come online anymore ? When I remove ip client open in the define start section he doesn't come online at all ???
    Is there something I could test with the ip client open function ?

    Thanks

    Standard HTML is that you send a request, and the server drops the connection ... so you may have to re-open the connection for every command.
  • Marc ScheibeinMarc Scheibein Junior Member Posts: 669
    Try this one
    send_string camera,"'GET axis-cgi/com/ptz.cgi?camera=1&move=right HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    
    'Connection: Keep-Alive' forces the server to keep the connection open instead of closing it after transfer like HTTP does.
    'Cache-Control: no-cache' tells the browser not to cache this transfer (may not be required for NetLinx, but it was in the original string, so I left it ;))
  • ericmedleyericmedley Senior Member - 3709 Posts Posts: 4,159
    Try this one
    send_string camera,"'GET axis-cgi/com/ptz.cgi?camera=1&move=right HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    
    'Connection: Keep-Alive' forces the server to keep the connection open instead of closing it after transfer like HTTP does.
    'Cache-Control: no-cache' tells the browser not to cache this transfer (may not be required for NetLinx, but it was in the original string, so I left it ;))

    I do know that many web server managers disable this feature. So, putting it in the string in no way ensures that the connection will stay alive. Keeping a connection alive past one transaction is a big security risk. I know I have it turned off on my web server. there is no error message sent, it just kills the connection.
  • damiendamien Junior Member Posts: 10
    Camera works with pan tilt zoom etc..
    Problem was I forgot the forward slash before axis.
    Correct string:
    send_string camera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=right HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"

    Thanks a lot for all the help and information.
  • Chip MoodyChip Moody Junior Member Posts: 727
    Based on my experience, I'd agree with saying that's more of a "request" than a "force". :)

    - Chip

    'Connection: Keep-Alive' forces the server to keep the connection open instead of closing it after transfer like HTTP does.
  • LLoganLLogan Junior Member Posts: 5
    Panasonic IP cams?

    Has anyone had success with a Panasonic IP cam? I don't see anything here about getting passed the login to the cams web server.
  • a_riot42a_riot42 AMX Wizard Posts: 1,619
    LLToolbox wrote: »
    Has anyone had success with a Panasonic IP cam? I don't see anything here about getting passed the login to the cams web server.

    You will have to send it the encoded username and password of the user unless you have it open for anyone to use. The encoding is base64 of which there are many examples on the web and I believe there is a AMX module that has implemented it as well.
    Paul
  • DHawthorneDHawthorne Junior Member Posts: 4,584
    a_riot42 wrote: »
    You will have to send it the encoded username and password of the user unless you have it open for anyone to use. The encoding is base64 of which there are many examples on the web and I believe there is a AMX module that has implemented it as well.
    Paul

    You have to send user name and password regardless. The first time you access a Panasonic camera, if it has no login, it requires you to create one.

    I have a full-blown module for controlling Panasonic cameras that works reasonably well (though not without one or two glitches). I don't, however, have it packaged for distribution, and it will be a few days before I can do so to share it.
  • a_riot42a_riot42 AMX Wizard Posts: 1,619
    From my understanding, if you set it up so a general user has access through the web interface you don't need to send a username and password. That is the way my company was running these cameras before I added the encoding to the module to keep things more private. I wonder if you were using a different camera server?
    Paul
  • DHawthorneDHawthorne Junior Member Posts: 4,584
    a_riot42 wrote: »
    From my understanding, if you set it up so a general user has access through the web interface you don't need to send a username and password. That is the way my company was running these cameras before I added the encoding to the module to keep things more private. I wonder if you were using a different camera server?
    Paul

    I'm talking directly to the cameras. It's possible I missed something, but I don't recall that being an option in the IP cameras. You can do that with the portal in their router, but if you can do it with the cameras themselves, I haven't found that option :).
  • LLoganLLogan Junior Member Posts: 5
    Panasonic IP Cam control

    After several hours of fiddling with it on site, I finally have it working. It's really rough, but a start.
    I setup the "Guest" account to have pan/tilt permission in the cam.

    I'm completely green here and I just starting throwing strings at it until it worked.
    Any more feedback is appreciated.

    Taken directly from my code...

    "'GET nphControlCamera?Direction=TiltUp HTTP/1.0',13,10,
    'HOST:10.0.0.201',13,10,'Connection:Keep-Alive',13,10,
    'Cache-Control:no-cache',13,10,13,10"

    The "Keep-Alive" part may leave this string today. I don't think it's working.
    I'm not very good at AMX IP comm and I need to refine that end as well.

    Is it typical to have tons of ONERROR activity?
  • viningvining X Member Posts: 4,353
    If the server permits "Connection: Persist" may help.
    http://www.w3.org/Protocols/HTTP/Issues/http-persist.html

    A little something I found for "Connnection: Keep-Alive".
    HTTP/1.1
    Under HTTP 1.1, the official keepalive method is different. All connections are kept alive, unless stated otherwise with the following header:

    Connection: close

    The Connection: Keep-Alive header no longer has any meaning because of this.

    Additionally, an optional Keep-Alive: header is described, but is so underspecified as to be meaningless. Avoid it.

    Not reliable
  • wirmwirm Junior Member Posts: 7
    So what is the proper way to open a ip connection with HTTP and then close it when you're done. Should i just keep sending the HTTP send_commands and not worry about the concurrent connections (they will eventually timeout after 30 - 60 seconds) or should i monitor my connections.
  • a_riot42a_riot42 AMX Wizard Posts: 1,619
    wirm wrote: »
    So what is the proper way to open a ip connection with HTTP and then close it when you're done. Should i just keep sending the HTTP send_commands and not worry about the concurrent connections (they will eventually timeout after 30 - 60 seconds) or should i monitor my connections.

    The proper way is to open it if its closed. You can keep track of the status of the port in the online/offline data_event. If its open, send the command, if it isn't, open it and wait for the online event to occur so you know its open and then send it. HTTP is a stateless protocol. You are asking for trouble if you try to code a workaround that relies on the port always being open. If you want to see what's going on write an ONERROR handler and print out what the error is, and if there is an error close the port.
    Paul
  • viningvining X Member Posts: 4,353
    HTTP will automatically close and I found in HTTP connection code I just wrote that it was better if I did nothing and let the server close the connection. I tried several different methods of opening and closing and found at least with the device I was talking to it was best to open a connection, send my get or post and wait for the the response and the server to drop the connection, get my offline event and if I had more request then re-connect.

    I posted the code here it you want to take a look.

    http://www.amxforums.com/showthread.php?p=25830#post25830
  • a_riot42a_riot42 AMX Wizard Posts: 1,619
    vining wrote: »
    HTTP will automatically close and I found in HTTP connection code I just wrote that it was better if I did nothing and let the server close the connection. I tried several different methods of opening and closing and found at least with the device I was talking to it was best to open a connection, send my get or post and wait for the the response and the server to drop the connection, get my offline event and if I had more request then re-connect.

    I posted the code here it you want to take a look.

    http://www.amxforums.com/showthread.php?p=25830#post25830

    This is my practice as well. I don't close the port programmatically but check to see if it is closed and respond accordingly.
    Paul
  • Pep_SDPep_SD Junior Member Posts: 106
    Do any of you have an example of how do you pass the login and password for the user of the camera?
    I can open the connection but it seems that this string just does nothing:
    
    button_event[dvTP, Test]
    {
        push:
        {
    	if(nCam1IsOnline)		//If Cam1 is online
    	    send_string dvCam1, "'GET Func=Date&Kind=1 HTTP/1.0',13,10,'HOST:192.168.1.70',13,10"
        }
    }
    
    

    I'm getting no error, no string from the data_event for dvCam1 but I always get an OFFLINE after the second consecutive push on the TP...

    Thanks for looking at this.

    Paul-Eric
  • Pep_SDPep_SD Junior Member Posts: 106
    Found my answer in this post: http://www.amxforums.com/showthread.php?t=633

    Thanks everyone!!
  • RajRaj Junior Member Posts: 53
    The camera is tilting on the second push

    hello friends,

    I really dont understand why i'm not able to tilt the camera on my first push itself. I'm using the following code.
    As of now what happens is only aftr i push the button two times consecutivley I'm able to tilt the camera.

    But i thot on the 1st push it might take sometime for the camera to come online so by the time of 2nd push the camera mite be ready to tkae the string.

    But its not the case. you have to push twice everytime you have to tilt. Do you guys have any idea why it happens like that. Thankyou very much.

    button_event[dvTP,200]
    {
    push:
    {

    ip_client_open(dvCamera.Port,'192.168.1.229',80,1)//80=port,1=TCP

    send_string dvCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=right HTTP/1.1',13,10,'HOST: 192.168.1.299',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }
    }
  • Spire_JeffSpire_Jeff Formerly Caffeinated Programmer Posts: 1,917
    Raj wrote: »
    As of now what happens is only aftr i push the button two times consecutivley I'm able to tilt the camera.

    But i thot on the 1st push it might take sometime for the camera to come online so by the time of 2nd push the camera mite be ready to tkae the string.

    But its not the case. you have to push twice everytime you have to tilt. Do you guys have any idea why it happens like that. Thankyou very much.
    My guess is that the camera closes the connection automatically after serving the response. What you should do is queue the command to send and open the connection in the button push. In the online section of the data event for dvCamera, remove the first command from the queue and send it to dvCamera. In the offline section of the data event for dvCamera, check to see if there is another command in the queue and if so, reopen the connection.

    This is assuming that the device closes the connection after sending a response. You should be able to verify this using the device notifications and/or diagnostic windows.

    Jeff
  • shanemshanem Junior Member Posts: 28
    try using a wait_until(Camera_Is_Online) before sending the command to the camera. Obviously to do this you will need to track the online/offline status of the camera
  • RajRaj Junior Member Posts: 53
    Thankyou Jeff and shanam,
    I can control the camera now. :)
  • RajRaj Junior Member Posts: 53
    PTZ not working

    Hdello frenz,
    I was jus tryin to control the PTZ axis camera using the format used in this forum.. but it doesnt seem to be working.. can yo please tll me y this aint wokring


    PROGRAM_NAME='incPTZAxisCamera'

    define_device
    dvTP_FamLivPTZCam = 10015:5:2

    dvAxisPTZCamera = 0:10:0
    dvMasterNIController2 = 0:1:0


    define_constant
    nIPPort = 80


    define_variable
    IP_ADDRESS_STRUCT MyIPAddr
    IP_ADDRESS_STRUCT ParkAreaPTZIPAddress

    char cIPAddress[] = {'172.30.16.168'}
    volatile dev dvTP_AxisPTZcontrolARRAY[]=
    {
    dvTP_FamLivPTZCam
    }

    integer nPTZParkingCameraBtn[]=
    {
    1, //UP dir
    2, //DWN dir
    3, //Left dir
    4, //Right dir
    5, //Zoom IN
    6, //Zoom OUT
    7, //Preset 1
    8, //Preset 2
    9 //Preset 3
    }

    integer nPTZParkingCameraONLINE //variable to check whther Camera is online
    integer nzoomvariable //used to store the value for zoom
    integer nzoomval
    define_event

    data_event[dvAxisPTZCamera]
    {
    ONLINE:
    {
    nPTZParkingCameraONLINE = 1
    }

    OFFLINE:
    {
    nPTZParkingCameraONLINE = 0
    }
    }


    button_event[dvTP_AxisPTZcontrolARRAY,nPTZParkingCameraBtn]
    {
    push:
    {
    if(!(nPTZParkingCameraONLINE))
    {
    IP_CLIENT_OPEN(dvAxisPTZCamera.Port,cIPAddress,nIPPort,IP_TCP)

    }
    wait_until(nPTZParkingCameraONLINE)
    {

    switch(get_last(nPTZParkingCameraBtn))
    {

    case 1:
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?move=up HTTP/1.1',13,10,'HOST: ',cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string 0,"'Checking'"
    }

    break
    case 2:
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=down HTTP/1.1',13,10,'HOST: ',cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }

    break
    case 3:
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=left HTTP/1.1',13,10,'HOST: ',cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }

    break
    case 4:
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=right HTTP/1.1',13,10,'HOST: ',cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }

    break
    case 5:
    {
    if(nzoomvariable>9999)
    {
    nzoomvariable = 9999
    }
    else
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&zoom=',nzoomvariable+1,' HTTP/1.1',13,10,'HOST: ',cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }
    }

    break
    case 6:
    {
    if(nzoomvariable<1)
    {
    nzoomvariable = 1
    }
    else
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&zoom=',nzoomvariable-1,' HTTP/1.1',13,10,'HOST: ',cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }
    }

    (*break
    case 7:
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 'cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }

    break
    case 8:
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 'cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }*)
    }
    }
    }
    hold[1,repeat]:
    {
    if(!(nPTZParkingCameraONLINE))
    {
    IP_CLIENT_OPEN(dvAxisPTZCamera.Port,cIPAddress,nIPPort,IP_TCP)

    }
    wait_until(nPTZParkingCameraONLINE)
    {
    switch(get_last(nPTZParkingCameraBtn))
    {
    case 1:
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?move=up HTTP/1.1',13,10,'HOST: ',cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }
    break
    case 2:
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: ',cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }

    break
    case 3:
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=down HTTP/1.1',13,10,'HOST: ',cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }

    break
    case 4:
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=left HTTP/1.1',13,10,'HOST: ',cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }

    break
    case 5:
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=right HTTP/1.1',13,10,'HOST: ',cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }

    break
    case 6:
    {
    if(nzoomvariable>9999)
    {
    nzoomvariable = 9999
    }
    else
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&zoom=',nzoomvariable+1,' HTTP/1.1',13,10,'HOST: ',cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }
    }

    break
    case 7:
    {
    if(nzoomvariable<1)
    {
    nzoomvariable = 1
    }
    else
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&zoom=',nzoomvariable-1,' HTTP/1.1',13,10,'HOST: ',cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }
    }

    (*break
    case 8:
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 'cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }

    break
    case 9:
    {
    //use the below string only by changing the IP adrr
    //send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 192.168.0.202',13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    send_string dvAxisPTZCamera,"'GET /axis-cgi/com/ptz.cgi?camera=1&move=up HTTP/1.1',13,10,'HOST: 'cIPAddress,13,10,'Connection: Keep-Alive',13,10,'Cache-Control: no-cache',13,10,13,10"
    }*)
    }
    }
    }
    }

    define_start
    GET_IP_ADDRESS(dvMasterNIController2, MyIPAddr)
    //GET_IP_ADDRESS(dvAxisPTZCamera,ParkAreaPTZIPAddress)

    (* Open The Client *)//dont use this , if without this oush button works.chek!
    IP_CLIENT_OPEN(dvAxisPTZCamera.Port,cIPAddress,nIPPort,IP_TCP)
Sign In or Register to comment.