logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
nomski  
#1 Posted : Wednesday, August 30, 2023 5:40:19 PM(UTC)
nomski

Rank: Advanced Member

Groups: Registered
Joined: 10/14/2016(UTC)
Posts: 64
Location: Sheffield

Hi all, hopefully someone can help here. We have a script to control a bunch of stuff on the main show PC and a secondary PC as well. Sadly it seems that we hit some kind of buffer with the commands to the secondary PC. If I hit the button a few times it then goes to "running" and won't continue doing anything. The script is:

Dim client = WebRequest.create("http://10.0.0.4:8088/API/?Function=MultiViewOverlayOn&Input=1&Value=1")
Dim response = client.GetResponse()
response.Close
sleep(100)
Dim client1 = WebRequest.create("http://10.0.0.4:8088/API/?Function=MultiViewOverlayOff&Input=1&Value=2")
Dim response1 = client1.GetResponse()
response.Close
sleep(100)
Dim client2 = WebRequest.create("http://10.0.0.4:8088/API/?Function=MultiViewOverlayOff&Input=1&Value=3")
Dim response2 = client2.GetResponse()
response.Close

I put the "sleeps" in to try and reduce the burden but to no avail.

Ideas on a postcard please!!
nomski  
#2 Posted : Thursday, September 7, 2023 8:54:40 PM(UTC)
nomski

Rank: Advanced Member

Groups: Registered
Joined: 10/14/2016(UTC)
Posts: 64
Location: Sheffield

I'm assuming nobody has an answer for this one...
pm  
#3 Posted : Thursday, September 7, 2023 9:49:27 PM(UTC)
pm

Rank: Advanced Member

Groups: Registered
Joined: 11/28/2015(UTC)
Posts: 182

Thanks: 10 times
Was thanked: 32 time(s) in 27 post(s)
Does it help not closing 3 times "response"?
nomski  
#4 Posted : Thursday, September 7, 2023 11:07:20 PM(UTC)
nomski

Rank: Advanced Member

Groups: Registered
Joined: 10/14/2016(UTC)
Posts: 64
Location: Sheffield

As the script stands it just locks it up after a couple of starts
dmwkr  
#5 Posted : Thursday, September 7, 2023 11:18:54 PM(UTC)
dmwkr

Rank: Advanced Member

Groups: Registered
Joined: 2/23/2019(UTC)
Posts: 540

Thanks: 62 times
Was thanked: 126 time(s) in 115 post(s)
Originally Posted by: nomski Go to Quoted Post
As the script stands it just locks it up after a couple of starts


I think pm means, that you are closing 'response' three times, but 'response1' and 'response2' not at all.
nomski  
#6 Posted : Thursday, September 7, 2023 11:21:27 PM(UTC)
nomski

Rank: Advanced Member

Groups: Registered
Joined: 10/14/2016(UTC)
Posts: 64
Location: Sheffield

For example, this is a good test script for it:
Dim client = WebRequest.create("http://10.0.0.53:8088/API/?Function=OverlayInput1In&Input=1")
Dim response = client.GetResponse()
response.Close
sleep(1000)
Dim client1 = WebRequest.create("http://10.0.0.53:8088/API/?Function=OverlayInput1Off")
Dim response1 = client1.GetResponse()
response.Close
sleep(1000)
Dim client2 = WebRequest.create("http://10.0.0.53:8088/API/?Function=OverlayInput1In&Input=1")
Dim response2 = client2.GetResponse()
response.Close
sleep(1000)
Dim client3 = WebRequest.create("http://10.0.0.53:8088/API/?Function=OverlayInput1Off")
Dim response3 = client3.GetResponse()
response.Close

If you run this a couple of times, it breaks. You can then wait a few minutes and it starts working again. Very odd!
nomski  
#7 Posted : Thursday, September 7, 2023 11:23:20 PM(UTC)
nomski

Rank: Advanced Member

Groups: Registered
Joined: 10/14/2016(UTC)
Posts: 64
Location: Sheffield

Originally Posted by: dmwkr Go to Quoted Post
Originally Posted by: nomski Go to Quoted Post
As the script stands it just locks it up after a couple of starts


I think pm means, that you are closing 'response' three times, but 'response1' and 'response2' not at all.


I see. I'll give that a go.
doggy  
#8 Posted : Thursday, September 7, 2023 11:28:42 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,188
Belgium
Location: Belgium

Thanks: 288 times
Was thanked: 946 time(s) in 781 post(s)
Assume you are trying it with a webrequest because you are controlling another computer as else you just could use the APi.Functions?

Webrequests do take some time to finish (if at all) , have you tried one at a time ( step by step debugging) and trying not to start the script again before being shure it has executed completly ?

Always a good idea to build in error traps within a script !
nomski  
#9 Posted : Thursday, September 7, 2023 11:35:25 PM(UTC)
nomski

Rank: Advanced Member

Groups: Registered
Joined: 10/14/2016(UTC)
Posts: 64
Location: Sheffield

Yes, controlling another PC. It seems that it's a rate of request thing that does it. If I just do one command it works. If I then bash the one command script a bunch of times, it breaks. If I have 3 or more web requests it breaks. It still responds if you run the same web request from a browser though which seems odd!
nomski  
#10 Posted : Thursday, September 7, 2023 11:37:42 PM(UTC)
nomski

Rank: Advanced Member

Groups: Registered
Joined: 10/14/2016(UTC)
Posts: 64
Location: Sheffield

SORTED!! Thanks so much. It was the not closing the responses correctly. Happy days!! That was driving me nuts.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.